cumSum function
The cumSum function returns the cumulative sum of the column, which is a sequence of partial sums of all the values in the rows before the current one, evaluated within groups defined by the group parameter if required.
Parameters
cumSum(column, group)
Parameter | Description |
---|---|
column | The attribute used to evaluate the cumulative sum. Its type must be numeral. The column parameter is mandatory. |
group | It allows you to group the results by a certain column’s values. |
Example
The following example uses the Bike Sales dataset.
Description | Screenshot |
---|---|
In this example, we want to calculate the cumulative sum of the Revenue attribute. Add a new column and type the following formula: | |
|