On this page
Kater SQL Functions Date parts
KATER__WEEK_OF_YEAR
The ISO week of its year, from 1 to 53.
Family: Date parts
Syntax
KATER__WEEK_OF_YEAR(field)Arguments
| Argument | Description |
|---|---|
field | The date or timestamp. |
Returns
A whole number. The field menu writes @format plain beside it, so it shows without a thousands separator.
Usage notes
- A day in early January can be in week 52 or 53 of the year before, and a day in late December in week 1.
- On Snowflake, the account’s
WEEK_OF_YEAR_POLICYsetting can change the numbers.
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_of_year', KATER__WEEK_OF_YEAR(orders.order_date)) AS "Week of Year"FROM kater_dataset.orders AS ordersORDER BY 1LIMIT 3| Order ID | Order Date | Week of Year |
|---|---|---|
| O00000 | 2025-05-26 | 22 |
| O00001 | 2025-11-28 | 48 |
| O00002 | 2025-07-25 | 30 |
Compiles to
EXTRACT(WEEK FROM orders.order_date)DATE_PART(WEEK, orders.order_date)