last() function

last() returns the last row with a non-null value from each input table.

Note: last() drops empty tables.

Function type signature
(<-tables: stream[A], ?column: string) => stream[A] where A: Record
For more information, see Function type signatures.



Column to use to verify the existence of a value. Default is _value.

If this column is null in the last record, last() returns the previous record with a non-null value.


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


Return the last row from each input table

import "sampledata"
    |> last()

View example input and output

Was this page helpful?

Thank you for your feedback!

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.