Skip to main content
Version: Next

mode

Takes the most common non-null grouped value.

mode(xs:list) -> any

Description

The mode function returns the most frequently occurring non-null value in xs.

xs: list

The values to evaluate.

Examples

Find the mode of values

from [
  {x: 1},
  {x: 1},
  {x: 2},
  {x: 3},
]
summarize mode_value=mode(x)
{mode_value: 1}

See Also

median, value_counts