cumnunique

Syntax

cumnunique(X, [ignoreNull=false])

Please see Cumulative Window Functions for the parameter description and windowing logic.

Arguments

ignoreNull (optional) is a Boolean value. If set to true, only non-NULL elements will be included in the calculation. The default value is false.

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)
// output: [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