mode() function

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

mode(column: "_value")

If there are multiple modes, it returns all of them in a sorted table. Mode only considers non-null values. If there is no mode, mode() returns null.

Empty tables

mode() drops empty tables.

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



The column to use to compute the mode. Default is "_value".


Input data. Default is piped-forward data (<-).


The following example uses data provided by the sampledata package to show how mode() transforms data.

import "sampledata"
    |> mode()

View input and output

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.