Aggregate function not working for retrieved list

Hello All, Problem: I'm encountering an unexpected behavior when using the aggregate list function to sum values from a retrieved list. Expected Behavior: The retrieval process successfully retrieves a list of values. The aggregate list function sums the values from the retrieved list and returns the total. Actual Behavior: When the aggregate list function references the retrieved list, the retrieval process seems to be skipped, resulting in an empty list. Causing the aggregate operation to produce an empty list. Impact: This issue prevents me from correctly calculating the sum of values retrieved through the retrieval activity.       Apart from the aggregate function, is there anything else I should be doing?
2 answers

Hi Yogeshwar, 


Which retrieval action you are talking about and which sum activity you are talking about 


Are you talking about the DealList if yes your list is empty then your sum will return zero


Also, for which list are you trying to find the sum?

As per your screenshot, you are trying to find the sum of the amount attribute from the CloseDealListQ1 List variable 

If yes , can you make sure whether your list as values , from your screenshot I am not able to find the list named CloseDealListQ1


Hello Yogeshwar Polawar,


First thing to know is that, Mendix optimizes the two action retrieve from database and aggregate function into just returning the aggregate function.


If you want to have the list still to fully retrieved then just add an action that uses the list later in the microflow a filter or something.


I think that the list is empty so probably the problem is in your xpath restriction.


Hope this helps,


Good Luck


documentation about the optimization: