cumnunique

Syntax

cumnunique(X)

Please see cumFunctions for the parameters and windowing logic.

Details

Return the cumulative count of unique elements in X.

Note: NULL values are included in the calculation.

Examples

$ v = [NULL, 1, 2, -6, 0, 1, 2]
$ cumnunique(v)
[1,2,3,4,5,5,5]

$ t = table(`a`a`b`c`a`b as id, 20 20 10 40 30 20 as val)
$ select cumnunique(id) as cumVal from t
cumVal
1
1
2
3
3
3