Navigation :
nthmax
nthmax, function
def process nthmax(value: number; nth: number): number
Returns the nth largest value within a group, with nth starting at 1.
value: values to rank.
nth: rank to return, must be between 1 and 100000.
Examples
table T = with
[| as Value |]
[| 2 |]
[| 0 |]
[| 1 |]
[| 4 |]
[| 3 |]
v = nthmax(T.Value; 2)
show table "Nth max" with
v as "Second"
This produces the following table:
If fewer than nth values exist, the smallest value is returned. Empty groups
return the default value.