Skip to content
Legacy docs for Tenzir v5.x. For the latest Tenzir v6 series, visit docs.tenzir.com. Migrating from v5? Read the Tenzir v6 migration guide.

Counts all distinct non-null grouped values.

count_distinct(xs:list) -> int

The count_distinct function returns the number of unique, non-null values in xs.

The values to count.

from {x: 1}, {x: 2}, {x: 2}, {x: 3}
summarize unique=count_distinct(x)
{unique: 3}

Last updated: