running-maximum
Returns the running maximum 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-maximum ( numeric_expression [ at expression { ,
expression } ] [ <for-option> ] [ prefilter ] )
running-maximum ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
running-maximum ( Qty )
Result
For each row, returns the quantity and a running maximum of the current and previous rows.
Result data
Name | Qty | Max | Running-Maximum (Qty) for name |
---|---|---|---|
Smith | 2 | 7 | 2 |
Smith | 3 | 7 | 3 |
Smith | 6 | 7 | 6 |
Smith | 7 | 7 | 7 |
Wong | 3 | 5 | 3 |
Wong | 5 | 5 | 5 |