Localized Week Options

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Localized week options define the start of a week and a year for the localized_week field in the EXTRACT and date_part and DATE_TRUNC functions.

Options 

  • first_day_of_localized_week => <value>: The first day of the localized week. If <value> is 1, every week and every year starts on a Monday. If <value> is 7, the week and year start on a Sunday.

  • minimal_days_in_localized_first_week => <value>: The minimum number of days that the localized first week of the year must contain to qualify as the first week of the year. The first week of a year starts on the first weekday defined by first_day_of_localized_week.

Examples 

These examples use this calendar:

MondayTuesdayWednesdayThursdayFridaySaturdaySunday
2024-12-302024-12-312025-01-012025-01-022025-01-032025-01-042025-01-05
2025-01-062025-01-072025-01-082025-01-092025-01-102025-01-112025-01-12
…………………
2025-12-292025-12-302025-12-312026-01-012026-01-022026-01-032026-01-04
2026-01-052026-01-062026-01-072026-01-082026-01-092026-01-102026-01-11

Require at Least 1 Day in the First Week 

1SELECT EXTRACT(localized_week FROM timestamp '2026-01-04', first_day_of_localized_week => 1, minimal_days_in_localized_first_week => 1);
2Result: 1

The first day of a week is set to Monday. The first week of 2026 starts on 2025-12-29 because it’s the first Monday of the week that has at least 1 day in 2026.

Require at Least 2 Days in the First Week 

1SELECT EXTRACT(localized_week FROM timestamp '2026-01-04', first_day_of_localized_week => 1, minimal_days_in_localized_first_week => 2);
2Result: 53

The first day of a week is set to Monday. The first week of 2026 starts on 2026-01-05 because it’s the first Monday of the week that has at least 2 days in 2026.

Require at Least 3 Days in the First Week 

1SELECT EXTRACT(localized_week FROM timestamp '2026-01-04', first_day_of_localized_week => 1, minimal_days_in_localized_first_week => 3);
2Result: 52

The first day of a week is set to Monday. The first week of 2026 starts on 2026-01-05 because it’s the first Monday of the week that has at least 3 days in 2026.

Related Documentation 

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!