last() function
The last()
function selects the last non-null record from an input table.
Function type: Selector
Output data type: Record
last(column: "_value")
Empty tables
last()
drops empty tables.
Parameters
column
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"
.
Data type: String
Examples
from(bucket:"example-bucket")
|> range(start:-1h)
|> filter(fn: (r) =>
r._measurement == "cpu" and
r._field == "usage_system"
)
|> last()
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.