Documentation

experimental.spread() function

The experimental.spread() function is subject to change at any time. By using this function, you accept the risks of experimental functions.

The experimental.spread() function outputs the difference between the minimum and maximum values in the _value column for each input table. The function supports uint, int, and float values. The output value type depends on the input value type:

  • uint or int input values return int values
  • float input values return float values

Function type: Aggregate
Output data type: Integer or Float

import "experimental"

experimental.spread()

Examples

import "experimental"

from(bucket: "example-bucket")
  |> range(start: -5m)
  |> filter(fn: (r) =>
    r._measurement == "example-measurement" and
    r._field == "example-field"
  )
  |> experimental.spread()

Set your InfluxDB URL

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.