Skip to main content
SUM_TOTAL
Tom Williams avatar
Written by Tom Williams
Updated over a year ago

Type: Function

Function: SUM_TOTAL

Syntax: SUM_TOTAL(field or expression)

Description: Sums a field or expression across all groupings (i.e. all records retrieved across the union of all dimensions).

The SUM_TOTAL aggregator may be used in custom formulas to create relative ratios and ponderate the result of other aggregators such as SUM or SUM_CUMULATIVE.

Sample usage:

  • SUM_TOTAL(lines_changed) returns the total number of lines changed across all groups.

  • ROUND(SUM(lines_changed) / SUM_TOTAL(lines_changed), 2) * 100 returns the percentage of lines of code changed that each group represents in comparison to the grand total.

  • ROUND(SUM_CUMULATIVE(lines_changed) / SUM_TOTAL(lines_changed), 2) * 100 returns the percentage of lines of code changed up until this point (e.g. from the beginning of the period up until this month) in comparison to the grand total.

Did this answer your question?