first

The first value by the measure's order_by (nulls included).

AggregateDeterministic

Flags

Flag Value
Kind aggregate
Nulls nulls are skipped
Deterministic yes
Order matters yes
Decomposable yes, by value and order key

Example

A pipeline from the language's tested corpus that uses first, over the example tables.

Hint
from orders
aggregate {first_status = first(status, order_by: {placed}), last_status = last(status, order_by: {placed desc}), all_ids = list(id, order_by: {id}), names = string_agg(status, sep: "|", order_by: {id})} by:{customer}

In a plan:

JSON
{
  "args": [
    {
      "col": 7
    }
  ],
  "fn": "first"
}