Documentation

experimental.last() function

Flux 0.112.0+

The experimental.last() function is subject to change at any time. By using this function, you accept the risks of experimental functions.

The experimental.last() function returns the last record with a non-null value in the _value column. experimental.last() is a selector function.

import "experimental"

experimental.last()

Empty tables

experimental.last() drops empty tables.

Parameters

tables

Input data. Default is piped-forward data (<-).

Examples

Return the last non-null value

import "experimental"

data
  |> experimental.last()
Input data
_time _value
2021-01-01T00:00:00Z 1.2
2021-01-01T00:01:00Z 0.6
2021-01-01T00:02:00Z 2.3
2021-01-01T00:03:00Z 0.9
Output data
_time _value
2021-01-01T00:03:00Z 0.9

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.