LAST_EACH
Returns an array of last values in the time window, grouped by a sub-key. The statement is limited to a maximum number of values.
Syntax
LAST_EACH([MAX VALUES, ]GROUP, VALUE)
Arguments
MAX VALUES:
limit of number of key\value elements in the output
GROUP:
field to aggregate by
VALUE:
field to sub-aggregate by
Returns
For each key aggregated in the query the function returns an array or key\value pairs of LAST values.
Notes
This function is non-deterministic.
AVAILABLE IN
Output Type Availablity Aggregate No Explicit Lookup Table Yes Inline Joins\Lookups No
Example
Data
Query
For each group get a list of users and their last connection time in the time window:
Results
Related Functions
LAST LAST_K LAST_K_EACH LAST_TIME_SERIES FIRST MAX_EACH
Dialog
Last updated