stddev() function

The stddev() function computes the standard deviation of non-null records in a specified column.

*Function type: Aggregate
**
Output data type:* Float

  1. stddev(
  2. column: "_value",
  3. mode: "sample"
  4. )

Parameters

column

The column on which to operate. Defaults to "_value".

*Data type: String*

mode

The standard deviation mode or type of standard deviation to calculate. Defaults to "sample".

*Data type: String*

The available options are:

sample

Calculates the sample standard deviation where the data is considered to be part of a larger population.

population

Calculates the population standard deviation where the data is considered a population of its own.

Examples

  1. from(bucket: "example-bucket")
  2. |> range(start: -5m)
  3. |> filter(fn: (r) =>
  4. r._measurement == "cpu" and
  5. r._field == "usage_system"
  6. )
  7. |> stddev()

Related articles