Documentation

experimental.mean() function

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

The experimental.mean() function computes the mean or average of non-null values in the _value column of each input table. Output tables contain a single row the with the calculated mean in the _value column.

Function type: Aggregate
Output data type: Float

import "experimental"

experimental.mean()

Examples

import "experimental"

from(bucket:"example-bucket")
  |> filter(fn: (r) =>
    r._measurement == "example-measurement" and
    r._field == "example-field")
  |> range(start:-1h)
  |> experimental.mean()

Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: