Documentation

increase() function

The increase() function calculates the cumulative sum of non-negative differences between subsequent values. A main use case is tracking changes in counter values which may wrap over time when they hit a threshold or are reset. In the case of a wrap/reset, we can assume that the absolute delta between two points will be at least their non-negative difference.

Function type: Transformation
Output data type: Float

increase(columns: ["_value"])

Parameters

columns

The columns to use in the operation. Defaults to ["_value"].

Data type: Array of strings

Output tables

For each input table with n rows, derivative() outputs a table with n - 1 rows.

Examples

from(bucket: "example-bucket")
  |> range(start: -24h)
  |> filter(fn: (r) =>
    r._measurement == "system" and
    r._field == "n_users"
  )
  |> increase()

Given the following input table:

_time_value
000011
000025
000033
000044

increase() produces the following table:

_time_value
000024
000034
000045

Function definition

increase = (tables=<-, column="_value") =>
	tables
		|> difference(nonNegative: true, column:column)
		|> cumulativeSum()

New! 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: