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 or int, the output is an int
  • For columns with type float, the output is a float.
spread(column: "_value")



The column on which to operate. Default is "_value".


Input data. Default is piped-forward data (<-).


The following example uses data provided by the sampledata package to show how spread() transforms data.

import "sampledata"
    |> spread()

View input and output

Was this page helpful?

Thank you for your feedback!

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.