Aggregated value indication

0
Hello! I have a problem with data indication on page. I have an Entity: Category (Enumeration) Year (Data-Time) Cost (Decimal) For “Category” I have c.7 different values. For “Year” 5 different values (2021-2025). A user can create multiple  Entity object. On the page I have to indicate aggregated “Costs” or totals for each year and for each category. I don’t want to create any dummy Entities to store totals for each year and for each category. I can only calculate it in Microflow but cannot pass it to the page. Could you please advise what is the best solution here?  
asked
1 answers
0

Hi Dmitri,

Whatever solution you chose, you will need some way to store the totals in order to display on the page, since Mendix doesn’t have the concept of “Variables” so far. 

Best solution is to create a two non-persistent entities one YearlyTotals  with attributes Year and Cost  and another one CategoryTotal with attributes Category and Cost

You can easily aggregate the sum in single step through OQL and assign to the two lists and pass the two lists to two different listviews on the page.

-Shekhar

answered