In the microflow, you can use Aggregate list activity to find the sum of prices of different objects of same entity.
If it’s a list of objects, they are from the same entity. If so, you can use the aggregation action as described by stella. If you have multiple lists of different entities or you need to build a sum accross different attributes of your objects, you need to create multiple sums (with the aggregate list action) and add them up in the end.
Mendix is optimizing the database call if you have a retrieve followed by an aggregate list action. It is then not retrieving the list, it does the aggregation on DB level. This faster than doing it at runtime. If you need to do multiple aggregations on the same list, it sometimes helps to retrieve this list multiple times and do an aggregation per list. If a list is used for multiple aggregations or for other stuff, the call will not be optimized.
So in general, you have a list of the same type of objects and attributes then you can use the aggregation function, but I am not sure what you mean. Can you provide an example?