covariance() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.65 is the most recent stable version of Flux.

The covariance() function computes the covariance between two columns.

Function type: Aggregate
Output data type: Float

covariance(columns: ["column_x", "column_y"], pearsonr: false, valueDst: "_value")



A list of columns on which to operate.

Data type: Array of strings

Exactly two columns must be provided to the columns property.


Indicates whether the result should be normalized to be the Pearson R coefficient.

Data type: Boolean


The column into which the result will be placed. Defaults to "_value".

Data type: String


from(bucket: "telegraf/autogen")
  |> range(start:-5m)
  |> covariance(columns: ["x", "y"])