[]
This function returns the value for the n-th row within the window frame. If there is no such row, the return value is null. It does not require ORDERBY.
NTHVALUE(value_function, n)
The function provides the following arguments.
Argument | Description |
---|---|
value_function | [required] The field name or formula. |
n | [required] The nth row within the window frame. The n should be a positive integer value. |
// WINDOW(NTHVALUE([@sold], 2), PARTITIONBY([city]),ORDERBY([month]))
city | month | sold | nth_value
----------------------------------------------
Paris 1 500 null
Paris 2 300 300
Paris 3 400 300
Rome 2 200 null
Rome 3 300 300
Rome 4 500 300