Skip to main content
Version: Next

distinct

Creates a sorted list without duplicates of non-null grouped values.

distinct(xs:list) -> list

Description

The distinct function returns a sorted list containing unique, non-null values in xs.

xs: list

The values to deduplicate.

Examples

Get distinct values in a list

from [
  {x: 1},
  {x: 2},
  {x: 2},
  {x: 3},
]
summarize unique=distinct(x)
{unique: [1, 2, 3]}

See Also

collect, count_distinct