Skip to main content

COUNT_IF_CUMULATIVE

Arnaud Lachaume avatar
Written by Arnaud Lachaume
Updated this week

Function: COUNT_IF_CUMULATIVE

Syntax: COUNT_IF_CUMULATIVE(condition)

Description: Returns a cumulative count of records matching the condition for each grouping, which takes into account the counts of previous groupings. The return values of this aggregator, therefore, depend on the sort order of the groupings (ascending or descending). When a field is provided, the function counts the number of records where the field value is not null.

Important: requires sorting on a dimension

The COUNT_IF_CUMULATIVE operator requires sorting your data on a dimension column. Sorting your data on a metric (e.g., another COUNT column) will result in incorrect results for the cumulative operator.

Sample usage:

  • COUNT_IF_CUMULATIVE(sub_type == "Bug") returns the cumulative count of Bug records, based on the requested sort-order.

  • COUNT_IF_CUMULATIVE(author_username ~ "doe$") returns the cumulative number of records where the author's name ends with "doe".

  • ROUND(COUNT_IF_CUMULATIVE(sub_type == "Feature") / IF_ZERO(COUNT(),1), 2) * 100 returns the accumulated percentage of Feature records compared to the grand total of records.

Did this answer your question?