Docs

v2.0

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

cumulativeSum(columns: ["_value"])

Parameters

columns

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

Data type: Array of strings

Examples

from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> filter(fn: (r) =>
    r._measurement == "disk" and
    r._field == "used_percent"
  )
  |> cumulativeSum(columns: ["_value"])

CUMULATIVE_SUM()


Bug Reports and Feedback

Thank you for being willing to help test InfluxDB v2.0 alpha! Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation.

Submit feedback in the InfluxData Community