derivative() function

The derivative() function computes the rate of change per unit of time between subsequent non-null records. It assumes rows are ordered by the _time column. The output table schema will be the same as the input table.

Function type: Aggregate
Output data type: Float

derivative(
  unit: 1s,
  nonNegative: false,
  columns: ["_value"],
<<<<<<< HEAD
  timeSrc: "_time"
=======
  timeColumn: "_time"
>>>>>>> flux-0.x
)

Parameters

unit

The time duration used when creating the derivative. Defaults to 1s.

Data type: Duration

nonNegative

Indicates if the derivative is allowed to be negative. When set to true, if a value is less than the previous value, it is assumed the previous value should have been a zero.

Data type: Boolean

columns

A list of columns on which to compute the derivative. Defaults to ["_value"].

Data type: Array of strings

timeColumn

The column containing time values. Defaults to "_time".

Data type: String

Examples

from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> derivative(unit: 1s, nonNegative: true)

DERIVATIVE()

This documentation is open source. See a typo? Please, open an issue.


Need help getting up and running? Get Support