For using aggregate functions in DataGrid, double click on the Units Sold column then under General tab set Aggregate Function as Sum
I am getting error but I need to use association for retrieve data based on filter is there any other way to do this.
I’d suggest to create an additional entity to show the aggregated number of units sold (you can decide if you need it persistent or non-persistent depending on your use-case).
I quickly created an application similar to yours and a solution could for example look like this:
The “Item” would be your “Realistic”-Entity. The “Summary”-Entity is used for showing the aggregated Item values. The “Overview” Page then would look like this.
On the page you have a surrounding data view which is the a “FilterSelector”-Object (created by the Datasource (DS) microflow). In the list view or data grid below you so the “Filtered” Association. When calling the page you create a “FilterSelector”-Object and set both Associations (All & Filtered) to the full list of Summary-Objects so that (without any selected Year or Month) all the Summary Objects are shown. While creating the FilterSelector you have to calculate the SumValue of the Summary-Objects. This could be done like this for example:
If you now want to filter this list you can simply put a on change (OCH) microflow on the reference selectors of the FilterSelector object. The performance advantage here as well is that you can always retrieve all summary-objects by the “All”-association from the FilterSelector and then filter this list like you need to. After that you change the FilterSelector-Objects “Filtered”-Association to that filtered list and do “Refresh in Client”.
You can adjust that method to your needs.
I hope that helps with your problem. Let me know if you need further information.