spread() function
The spread()
function outputs the difference between the minimum and maximum values in a specified column.
spread()
is an aggregate function.
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.
spread(column: "_value")
Parameters
column
The column on which to operate.
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 spread()
transforms data.
import "sampledata"
sampledata.int()
|> spread()
Was this page helpful?
Thank you for your feedback!
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, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.