Aggregate nth(TYPE d, integer index) TYPE

d - Operates on decimal, float, integer, string, boolean or location types.
index - The index into the window to return.
Return the window element that is the specified distance from the start of the window.

A positive (or zero) argument counts from the start of the window. A negative argument counts from the end of the window.

If there are too few items in the window to satisfy the index, then NaN is returned for float or decimal types. Otherwise a default-initialized value is returned.

nth(a, 0) is the same as first(a).

nth(a, -1) is the same as last(a).

All values in the window are treated identically, including NaN and other IEEE special values.