cumsum_asc
relationalai.semantics.std.aggregates
cumsum_asc(*args: AggValue) -> AggregateCompute cumulative sum in ascending order.
All arguments except the last are ordering keys (sorted ascending). The last argument is the value to accumulate.
Parameters
Section titled “Parameters”
(*argsAggValue, default:()) - One or more ordering keys followed by the value to accumulate. For example,cumsum_asc(key, value)computes a cumulative sum ofvalueordered ascending bykey.
Returns
Section titled “Returns”Aggregate- AnAggregaterepresenting the cumulative sum computation.
Examples
Section titled “Examples”Get running tally of points earned over rounds, grouped by player:
>>> select(Player.name, Player.round, cumsum_asc(Player.round, Player.round.points).per(Player))