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!

Introducing InfluxDB 3.0

The new core of InfluxDB built with Rust and Apache Arrow. Available today in InfluxDB Cloud Dedicated.

Learn more

State of the InfluxDB Cloud Serverless documentation

The new documentation for InfluxDB Cloud Serverless is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.