Skip to main content

final class atoti.CumulativeScope

Scope performing a cumulative aggregation.

Example

Using this scope with atoti.agg.sum() to perform a cumulative sum (also called running sum or prefix sum):
Using dense:
Using partitioning:
window can be a:
  • range starting with a <=0 value and ending with a >=0 value.
  • time period window as a two-element tuple of either None or a period as specified by Java’s Period.parse().

dense : bool = False

When True, all members of level, even those with no value for the underlying measure, will be taken into account, possibly leading to repeated values.

level : HasIdentifier[LevelIdentifier] | LevelIdentifier

The level along which member values are cumulated.

partitioning : HasIdentifier[LevelIdentifier] | LevelIdentifier | None = None

The level at which to start the aggregation over. If not None, partitioning must part of the same hierarchy as level and be “above” it (i.e. before it in list(hierarchy)).

window : range | tuple[str, str] | tuple[str | None, str] | tuple[str, str | None] | None = None

The window defining the sliding range selecting members before and after the current one (using level’s order) to be aggregated. Default to range(-∞, 0), meaning that the aggregated value for a given member is computed using all the members before it, itself, and no members after it.