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
Parameters
column
The column to use to compute the mode.
Default is "_value"
.
tables
Input data.
Default is piped-forward data (<-
).
Examples
The following example uses data provided by the sampledata
package
to show how mode()
transforms data.
import "sampledata"
sampledata.int()
|> mode()
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.