lastval — aggregate function to return the last value from a specified column.
This function returns the last non-null value, if any, in the range of values returned by its query predicate.
expr must contain the name of a
column in a LiveView table. The returned last value is of the same type as the
If the query returns no rows, the aggregate returns
This example shows a simple use of the lastval() function.
In LiveView Desktop connected to a server running the Hello LiveView sample, select the ItemsSales table from the Tables pane of the LiveView Tables view.
In the Select field, enter:
lastval(Item) as Last
Make sure the Query field is empty.
The query results open in a grid view. The value continuously updates as new values arrive.
This LiveView aggregate function is based on the lastval aggregate function in the StreamBase expression language.