spread() function
The spread()
function outputs the difference between the minimum and maximum values in a specified column.
Only uint
, int
, and float
column types can be used.
The type of the output column depends on the type of input column:
- For columns with type
uint
orint
, the output is anint
- For columns with type
float
, the output is a float.
Function type: Aggregate
Output data type: Integer or Float (inherited from input column type)
spread(column: "_value")
Parameters
column
The column on which to operate. Defaults to "_value"
.
Data type: String
Examples
from(bucket: "example-bucket")
|> range(start: -5m)
|> filter(fn: (r) =>
r._measurement == "cpu" and
r._field == "usage_system"
)
|> spread()
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.