firstval
firstval — aggregate function to return the first value from a specified column.
DESCRIPTION
This function returns the first value in the range of values returned by its query predicate.
Expression expr
must contain the name of a column in a LiveView table. The returned first value is of the same type as the specified column.
If the query returns no rows, the aggregate returns null
when group-by is not specified, and no rows when a group-by is specified.
EXAMPLE
This example shows a simple use of the firstval() 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:
firstval(Item) as First
-
Make sure the Query field is empty.
-
Click
.
The query results open in a grid view.
SEE ALSO
This LiveView aggregate function is based on the firstval aggregate function in the StreamBase expression language.