The RunningSum() function is one of several running aggregate functions available for calculating data in Web Intelligence.
Other running aggregate functions include:
- RunningAverage()
- RunningCount()
- RunningMax()
- RunningMin()
- RunningProduct()
A running sum is a total that is accumulated from value to value across a series of values.
You can use the RunningSum() function to return the running sum of a set of numbers. One feature of running aggregate functions is that a reset can be applied to them within the report. This allows you to start the cumulative total again at a given value (for example, at a break).
The syntax for using the RunningSum() function is:
Number RunningSum([measure] ; [Row|Col] ; [(reset_dimensions)])
Syntax of RunningSum() Function
The following table describes the components of the syntax of the RunningSum() function
Syntax Component | Description |
---|
[measure] | This refers to any measure object in the data provider |
Row|Col | This refers to the calculation direction (optional parameter) |
reset_dimensions | This refers to the list of dimensions used to reset the running sum (optional parameter) |
Usage of the RunningSum() Function – 1
You create a report to show State, Year, and Sales revenue with a break by State. You need to add another column to the report to display a running sum.
Use the formula:
=RunningSum([Sales revenue])
If you add a Running Total column to the report, the report displays as shown.
Usage of the RunningSum() Function – 2
If you want the running total to be reset for each state, modify the formula to reset the total each time the table breaks.
Use the following syntax to modify the formula:
=RunningSum([Sales revenue] ; ([State]))