running-count

Returns the running count by row (including the current row) for a set of values. The "<for-option>" defines the scope of the function. The "at" option defines the level of aggregation and can be used only in the context of relational datasources.

Syntax

running-count ( numeric_expression [ at expression { , expression } ] 
[ <for-option> ] [ prefilter ] )
running-count (  numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto

Example

running-count ( Qty )

Result

For each row, returns the quantity and a running count of the position of the current row.

Result data

Name Qty Count Running-Count for name
Smith 7 4 1
Smith 3 4 2
Smith 6 4 3
Smith 4 4 4
Wong 3 3 1
Wong 5 3 2