On this page
Kater SQL Functions Aggregations
KATER__MAX
The largest value of the field.
Family: Aggregations
Syntax
KATER__MAX(field)Arguments
| Argument | Description |
|---|---|
field | The field to aggregate. |
Returns
A value of the field’s own type. The field menu writes the @format of the field it reads beside it, or @format number(2) where that field has none and can have decimals.
Usage notes
- On a date, it is the latest. On text, it is the last in the warehouse’s sort order.
- Empty values are left out.
Example
This Sandbox query reads the sample shop’s orders. The table shows the rows that Kater gave.
SELECT orders.region AS "Region", KATER__MAX(orders.order_date) AS "Last Order"FROM kater_dataset.orders AS ordersGROUP BY orders.regionORDER BY 1| Region | Last Order |
|---|---|
| AMER | 2026-09-30 |
| APAC | 2026-09-30 |
| EMEA | 2026-09-29 |
| LATAM | 2026-09-29 |
| null | 2026-09-11 |
Compiles to
The call compiles to the same SQL on DuckDB and on Snowflake.
MAX(orders.order_date)See also
- Measures
- Other functions in Aggregations:
KATER__SUM,KATER__AVG,KATER__MIN,KATER__COUNT,KATER__COUNT_DISTINCT,KATER__COUNT_TRUE,KATER__COUNT_FALSE,KATER__LIST