Relative date filters for weeks

Pentaho Schema Workbench

Version
10.1.x
Audience
anonymous
Part Number
MK-95PDIA009-04

Use relative date filters for weeks to control the starting day of the week, the number of days comprising the first calendar week, and the starting calendar week of each year. If your week number and week year are required to be ISO8601 week-date compliant, or if you need to account for cultural time-keeping differences, you can customize how week numbers and week years are generated for the w and YYYY format strings.

Configure the following filter.relative.dates.week properties in the analyzer.properties file:

Property Description Default value
filter.relative.dates.week.firstDayOfWeek Specifies the first day of the week. Values are Sunday=1, Monday=2, Tuesday=3, Wednesday=4, Thursday=5, Friday=6, and Saturday=7. 2
filter.relative.dates.week.minimalDaysInFirstWeek Specifies the number of days considered to define the first week of a year. The ISO8601 standard requires 4 days to be present before counting the first week. 4
filter.relative.dates.week.firstWeekOnJanuary1st Specifies the week number so that the first week of the calendar always starts on January 1st. When this property is set to true, the week year and the calendar year are the same. false
filter.relative.dates.week.firstWeekOnJanuary1st.fromOne If filter.relative.dates.week.firstWeekOnJanuary1st=true and the first week does not have the minimal number of days, this property specifies if week numbering should start at 0 or 1. false

For example, an alternative method for week numbering commonly used in the United States starts week 1 of every year on January 1st with the first day of all subsequent weeks starting on a Sunday. For this method, configure the following properties with the associated values:

  • filter.relative.dates.week.firstDayOfWeek=1
  • filter.relative.dates.week.minimalDaysInFirstWeek=4
  • filter.relative.dates.week.firstWeekOnJanuary1st=true
  • filter.relative.dates.week.firstWeekOnJanuary1st.fromOne=true
Note: The week year (YYYY) uses a different format string than the calendar year (yyyy). For example, in the ISO8601 week date, the date 2018-12-31 belongs to week 2019-W1, so the calendar year is 2018 and the week year is 2019. In the previous United States week example, the calendar year and the week year are always the same, so the format string may use yyyy or YYYY.