2.341.7.20 Aggregate Function: RunningValue

The following are the arguments, types, and specification of the RunningValue aggregate function.

Function

Argument

Type

Specification

RunningValue

Return

See the Function argument.*

A running aggregate of the expression, using the specified aggregate function.

Expression

See Function

The expression to aggregate. MUST NOT contain the First, Last, Previous, or RunningValue functions. Can reference other aggregate functions if their Scope is the same as, or a child scope of, this function's Scope. For all distinct scopes directly** referenced in the expression, there MUST be one scope that has all other scopes as its ancestor.

Function

Enum

Name of an aggregate function for which to calculate a running value (MUST NOT be CountRows, RunningValue, RowNumber, or Aggregate).

Expression type and Return type are determined by the aggregate function used.

Scope

String

If specified, MUST be "Nothing", or the name of a group or data region that contains (directly or indirectly) the report item that the aggregate function is used in.

The scope specifies that the running value is either reset whenever the group expression changes or reset with each new instance of the data region.

A value of "Nothing" specifies that the running value never resets. The Scope argument MUST be a constant, not an expression.

* The Return data type is determined by the function that is used in the FunctionEnum argument of the RunningValue call. For example, if Sum is used as FunctionEnum value for RunningValue, the return type follows the rules for the Sum function.

** Directly referenced aggregate functions are contained within the Expression argument but are not contained within a nested aggregate or the Destination or Result arguments to a Lookup function.