Berserk Docs
Aggregate FunctionsMake / Collect

last

Returns the value of the expression from the row with the latest timestamp.

Syntax

last(expr)

Parameters

Prop

Type

Returns: any

Examples

Example 1

datatable(region:string, $time:datetime, raid:string)[
  "England", datetime(2024-06-08), "Lindisfarne",
  "England", datetime(2024-11-01), "York",
  "Francia", datetime(2024-03-28), "Paris"
]
| summarize last(raid) by region
region (string)$time (dynamic)raid (dynamic)
England2024-11-01T00:00:00Z"York"
Francia2024-03-28T00:00:00Z"Paris"

On this page