MicroStrategy ONE
RunningMax (Running Maximum)
Returns the running maximum value in a list of values by comparing the current and preceding values. The evaluation can restart based on attributes identified in the parameter settings. This is an OLAP function.
Syntax
RunningMax <BreakBy, SortBy>(Argument)
Where:
BreakByis the attribute indicating where the calculation restarts.SortByis the attribute or metric by which the data is sorted.Argumentis a metric representing the list of numbers.
Expression
Where:
yi= metric value at the ith rown= number of rows/metric values
Example
This simple example illustrates how the RunningMax function moves through a list of values comparing each value to the highest value identified so far and returning the maximum value as it progresses. The calculation is shown in the following table.
| Values | RunningMaximum |
|
8 |
|
|
6 |
8 (8>6) |
|
10 |
10 (10>8) |
|
9 |
10 (10>9) |
|
5 |
10 (10>5) |
