Skip to main content
On this page

Kater SQL Functions Date parts

KATER__DAY_OF_WEEK_INDEX

The day's number in its week, from 0 for Sunday to 6 for Saturday.

Family: Date parts

Syntax

KATER__DAY_OF_WEEK_INDEX(field)

Arguments

ArgumentDescription
fieldThe date or timestamp.

Returns

A whole number. The field menu writes @format plain beside it, so it shows without a thousands separator.

Usage notes

  • On Snowflake, the account’s WEEK_START setting 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_day_of_week_index', KATER__DAY_OF_WEEK_INDEX(orders.order_date)) AS "Day of Week Index"
FROM kater_dataset.orders AS orders
ORDER BY
1
LIMIT 3
Order IDOrder DateDay of Week Index
O000002025-05-261
O000012025-11-285
O000022025-07-255

Compiles to

EXTRACT(DAYOFWEEK FROM orders.order_date)
DATE_PART(DAYOFWEEK, orders.order_date)

See also