max() function

The max() function selects record with the highest _value from the input table.

*Function type: Selector
**
Output data type:* Record

  1. max(column: "_value")

Empty tables

max() drops empty tables.

Parameters

column

The column to use to calculate the maximum value. Default is "_value".

*Data type: String*

Examples

  1. from(bucket:"example-bucket")
  2. |> range(start:-1h)
  3. |> filter(fn: (r) =>
  4. r._measurement == "cpu" and
  5. r._field == "usage_system"
  6. )
  7. |> max()

Related articles