---
title: mode() function
description: >
  The `mode()` function computes the mode or value that occurs most often in a
  specified column in the input table.
aliases:
  - /v2.0/reference/flux/functions/built-in/transformations/aggregates/mode/
menu:
  v2_0_ref:
    name: mode
    parent: built-in-aggregates
weight: 501
related:
  - https://docs.influxdata.com/influxdb/latest/query_language/functions/#mode, InfluxQL – MODE()
---

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

_**Function type:** Aggregate_  

```js
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`.

##### Supported data types

- String
- Float
- Integer
- UInteger
- Boolean
- Time

## Parameters

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

_**Data type:** String_

## Examples

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