2 Aggregate Functions for same column in Data Grid

0
I am using a Data Grid and have a currency column.  I set the Aggregate Function to be Sum.  The user would also like to see the Average in a row below the Sum.   I added the same column again and set its Aggregate Function to Average but it does not work.  First off, the Aggregate Caption gets changed to “Average” for both the Sum column and the Avg column.  Also, the average is not even close.   It appears to be using values from the next column to the right even though I did pick the proper Attribute in the path. I thought of just adding a label below the data grid, which would look odd but might work.  But I can’t find any way to take the rows from the Data Grid and call a Microflow without someone clicking a button.   I did add an action button to the grid toolbar and called a Microflow passing in a list of entities from the grid and that actually does work.  But it’s clunky. Does anyone have any other suggestions?
asked
1 answers
0

Ok so first off this seems like a Mx bug to me, you could file a support ticket for this: https://support.mendix.com/hc/en-us

As a workaround you could calculate the aggregates yourself with microflows, you have a couple of options:

  1. Calculated them and store them in a attribute, calculation could be done after saving a value for example
  2. Create a calculated attribute https://docs.mendix.com/refguide/attributes#4-1-value
  3. Use a widget > for a example https://appstore.home.mendix.com/link/app/147/


In all these cases creating a Parent or Aggregation entity might help you to display these values.

answered