docs-v2/content/flux/v0.x/stdlib/experimental/spread.md

1.4 KiB
Raw Blame History

title description menu weight aliases related flux/v0.x/tags introduced
experimental.spread() function The `experimental.spread()` function outputs the difference between the minimum and maximum values in the `_value` column for each input table.
flux_0_x_ref
name parent
experimental.spread experimental
302
/influxdb/v2.0/reference/flux/stdlib/experimental/spread/
/influxdb/cloud/reference/flux/stdlib/experimental/spread/
/flux/v0.x/stdlib/universe/spread/
/{{< latest "influxdb" "v1" >}}/query_language/functions/#spread, InfluxQL SPREAD()
transformations
aggregates
0.107.0

The experimental.spread() function outputs the difference between the minimum and maximum values in the _value column for each input table. experimental.spread() is an aggregate function.

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
import "experimental"

experimental.spread()

Parameters

tables

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

Examples

import "experimental"

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