Skip to main content
On this page

Kater SQL Functions Aggregations

KATER__MAX

The largest value of the field.

Family: Aggregations

Syntax

KATER__MAX(field)

Arguments

ArgumentDescription
fieldThe 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 orders
GROUP BY
orders.region
ORDER BY
1
RegionLast Order
AMER2026-09-30
APAC2026-09-30
EMEA2026-09-29
LATAM2026-09-29
null2026-09-11

Compiles to

The call compiles to the same SQL on DuckDB and on Snowflake.

MAX(orders.order_date)

See also