Skip to content

cumsum_asc

relationalai.semantics.std.aggregates
cumsum_asc(*args: AggValue) -> Aggregate

Compute cumulative sum in ascending order.

All arguments except the last are ordering keys (sorted ascending). The last argument is the value to accumulate.

  • *args

    (AggValue, default: ()) - One or more ordering keys followed by the value to accumulate. For example, cumsum_asc(key, value) computes a cumulative sum of value ordered ascending by key.
  • Aggregate - An Aggregate representing the cumulative sum computation.

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))
RelationalAI Documentation
└──  Release Notes
    └──  Python API Release Notes
        └──  What’s New in Version 1.0.13
            └──  New Features and Enhancements