Cume

The Cume function returns a cumulative running total for each value in a column of numbers.

Cume (numbers, break_col)

where:

numbers references the column that contains the numbers on which the cume is calculated.

break_col is an optional parameter that references a break column.

Note:

If constant values in the break_value column are substituted for data items, dates and text strings must be enclosed in single quotes.

The following examples show the results of inserting the Cume function in two separate tables.

Example 1

In this example, the Cume function is used on the numeric column. The results are shown in the Computed column.

Cume (Amount)

Table 158. Cume Example 1

State

City

Amount

Computed

AZ

Tucson

112

112

CA

Burbank

240

352

CA

Glendale

97

449

FL

Palmetto

70

519

MD

Laurel

97

646

MI

Detroit

208

824

MN

Eagan

159

983

NY

New York

490

1473

NY

Rochester

180

1653

Example 2

In this example, the Cume function is used on the numeric column and break_column. The results are shown in the Computed column.

Cume (Amount, State)

Table 159. Cume Example 2

State

City

Amount

Computed

AZ

Tucson

112

112

CA

Burbank

240

240

CA

Glendale

97

337

FL

Palmetto

70

70

MD

Laurel

97

97

MI

Detroit

208

208

MN

Eagan

159

159

NY

New York

490

490

NY

Rochester

180

670