max() function
The max()
function selects record with the highest _value
from the input table.
*Function type: Selector
**Output data type:* Record
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
from(bucket:"example-bucket")
|> range(start:-1h)
|> filter(fn: (r) =>
r._measurement == "cpu" and
r._field == "usage_system"
)
|> max()