last() function

The last() function selects the last non-null record from an input table. last() is a selector function.

last(column: "_value")

Empty tables

last() drops empty tables.



Column used to verify the existence of a value. If this column is null in the last record, last() returns the previous record with a non-null value. Default is "_value".


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


The following example uses data provided by the sampledata package to show how last() transforms data.

import "sampledata"
    |> last()

View input and output

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.