On this page
Kater SQL Functions Date grains
KATER__WEEK
The first day of the week the date is in.
Family: Date grains
Syntax
KATER__WEEK(field)Arguments
| Argument | Description |
|---|---|
field | The date or timestamp. |
Returns
A date.
Usage notes
- A week starts on Monday, as an ISO week does. On Snowflake, the account’s
WEEK_STARTsetting can change the first day.
Example
This Sandbox query reads the sample shop’s orders. The table shows the rows that Kater gave.
SELECT orders.order_id AS "Order ID", orders.order_date AS "Order Date", DIMENSION('order_date_week', KATER__WEEK(orders.order_date)) AS "Week"FROM kater_dataset.orders AS ordersORDER BY 1LIMIT 3| Order ID | Order Date | Week |
|---|---|---|
| O00000 | 2025-05-26 | 2025-05-26 |
| O00001 | 2025-11-28 | 2025-11-24 |
| O00002 | 2025-07-25 | 2025-07-21 |
Compiles to
The call compiles to the same SQL on DuckDB and on Snowflake.
CAST(DATE_TRUNC('WEEK', orders.order_date) AS DATE)See also
- Dates
- Other functions in Date grains:
KATER__DATE,KATER__MONTH,KATER__QUARTER,KATER__YEAR,KATER__HOUR,KATER__MINUTE,KATER__SECOND,KATER__MILLISECOND