How to get sum value by using Microflow.

0
Hi, I am trying to sum the Units sold based on filters and show in the table.   the output should look like this. but I am getting each and every row based on filters before iteration applies to microflow but required single row by sum of units sold as shown above.   and In domain model I have added other entity "SumofUnitsSold" to store the data of Sum of "units sold" and the page is  and on search button calling the microflow is and create object in the iteration is Now my output is  I am unable to get the sum value of units sold. Can you please help me with this.  
asked
1 answers
1

Hi,

Several possible ways to approach this come to mind.

Change the domain model to group “Realistic” objects per period. So you would get Realisatic → ProductPeriod → Product.  {edit: removed part about aggregate function, that was a mistake).

You can now calculate sums using aggregate list activities in microflows. The result could be stored as attribute value, or you could use a calculated value to calc the values on the fly.

An example:

“sum” is a calculated attribute. The microflow used looks like this:

The you can use a datagrid to display the values:

Or you could use OQL, but i always find that a bit tricky: https://docs.mendix.com/refguide/oql-group-by-clause/

I hope this helps.

answered