Skip to main content
atoti.CumulativeScope(
    level: HasIdentifier[LevelIdentifier] | LevelIdentifier,
    *,
    dense: bool = False,
    partitioning: HasIdentifier[LevelIdentifier] | LevelIdentifier | None = None,
    window: range | tuple[str, str] | tuple[str | None, str] | tuple[str, str | None] | None = None,
)
Scope performing a cumulative aggregation. 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().

Attributes

level

The level along which member values are cumulated.

dense

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.

partitioning

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

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.