Documentation

mode() function

mode() returns the non-null value or values that occur most often in a specified column in each input table.

If there are multiple modes, mode() returns all mode values in a sorted table. If there is no mode, mode() returns null.

Note: mode() drops empty tables.

Function type signature
(<-tables: stream[A], ?column: string) => stream[{B with _value: C}] where A: Record, B: Record
For more information, see Function type signatures.

Parameters

column

Column to return the mode from. Default is _value.

tables

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

Examples

Return the mode of each input table

import "sampledata"

sampledata.int()
    |> mode()

View example input and ouput


Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.