mode() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.50 is the most recent stable version of Flux.

The mode() function computes the mode or value that occurs most often in a specified column in the input table.

Function type: Aggregate

mode(column: "_value")

Multiple modes are returned in a sorted table. If there is no mode, mode() returns null.

Supported data types
  • String
  • Float
  • Integer
  • UInteger
  • Boolean
  • Time



The column to use to compute the mode. Defaults to "_value".

Data type: String


Return the mode of windowed data
from(bucket: "telegraf/autogen")
  |> filter(fn: (r) =>
    r._measurement == "errors" and
    r._field == "count_per_minute"
  |> range(start:-12h)
  |> window(every:10m)
  |> mode()