Table - Generate column and calculate running total (cumulative total) for an Entity


I have an Entity : Object
I am using entity as collection datasource.

Attributes : Name, Number, Value, total
I will be sorting the Table based on Value attribute from high to low using a query.

I am planning to calculate cumulative total based on sorted list.
I will also be sorting the collection programmatically based on Value attribute.

Based on the sorted list, I would like to calculate cumulative sum and set it to the generated column (column name = Total(Cumulative)).

Your inputs will help.


So what have you done so far? What works for you and what doesn’t?


Thank you for your response.

I am able to sort the collection programatically based on Value attribute.

Example : Collection objectList holds the sorted list of Objects based on Value attribute.

I also have a list of objects with Value high to low in descending order as in the table (using query in CollectionDs).

Example : objectTable.

Now I want to create a generated column called “Total(Cum)”.

I want to calculate cumulative Sum = Total(previous row) + Total(current row) for each row in the Generated Column “Total(Cum)”.

This issue has been solved and fixed.