cumulativeSum() function

The cumulativeSum() function computes a running sum for non-null records in the table. The output table schema will be the same as the input table.

_Function type: Transformation
*Output data type: Float*

  1. cumulativeSum(columns: ["_value"])

Parameters

columns

A list of columns on which to operate. Defaults to ["_value"].

*Data type: Array of strings*

Examples

  1. from(bucket: "example-bucket")
  2. |> range(start: -5m)
  3. |> filter(fn: (r) =>
  4. r._measurement == "disk" and
  5. r._field == "used_percent"
  6. )
  7. |> cumulativeSum(columns: ["_value"])

Related articles