On this page
Kater SQL Functions Aggregations
KATER__MIN
The smallest value of the field.
Family: Aggregations
Syntax
KATER__MIN(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 earliest. On text, it is the first 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__MIN(orders.order_date) AS "First Order"FROM kater_dataset.orders AS ordersGROUP BY orders.regionORDER BY 1| Region | First Order |
|---|---|
| AMER | 2025-01-01 |
| APAC | 2025-01-02 |
| EMEA | 2025-01-02 |
| LATAM | 2025-01-01 |
| null | 2025-01-14 |
Compiles to
The call compiles to the same SQL on DuckDB and on Snowflake.
MIN(orders.order_date)See also
- Measures
- Other functions in Aggregations:
KATER__SUM,KATER__AVG,KATER__MAX,KATER__COUNT,KATER__COUNT_DISTINCT,KATER__COUNT_TRUE,KATER__COUNT_FALSE,KATER__LIST