Skip to main content
CUMULATIVE SUM

Calculates the cumulative sum of a specified numeric field across a range or partition

Updated over a month ago

Description

The CUMULATIVE_SUM() function calculates the cumulative sum of a specified numeric field across a range or partition. It is useful for tracking the running total.

Syntax

CUMULATIVE_SUM(number)

Output

numeric

Variables

  1. number: the numeric field to be cumulative summed.

Example

CUM SUM(Value) Over (Partition by Group Order by ID)

ID

Group

Value

CUMULATIVE_SUM

1

A

10

10

2

A

20

30

3

A

15

45

4

B

30

30

5

B

40

70

Did this answer your question?