1.9 KiB
1.9 KiB
title | description | aliases | menu | weight | flux/v0.x/tags | related | introduced | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
last() function | The `last()` function selects the last non-null record from an input table. |
|
|
102 |
|
|
0.7.0 |
The last()
function selects the last non-null record from an input table.
last()
is a selector function.
last(column: "_value")
{{% warn %}}
Empty tables
last()
drops empty tables.
{{% /warn %}}
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"
.
tables
Input data.
Default is piped-forward data (<-
).
Examples
{{% flux/sample-example-intro %}}
import "sampledata"
sampledata.int()
|> last()
{{% expand "View input and output" %}} {{< flex >}} {{% flex-content %}}
Input data
{{% flux/sample "int" %}}
{{% /flex-content %}} {{% flex-content %}}
Output data
tag | _time | _value |
---|---|---|
t1 | 2021-01-01T00:00:50Z | 4 |
tag | _time | _value |
---|---|---|
t2 | 2021-01-01T00:00:50Z | 1 |
{{% /flex-content %}} {{< /flex >}} {{% /expand %}}