Thanks for your answer, but still it looks like week is not starting on Sunday on my CB instance.
select DATE_PART_MILLIS(MILLIS(“2016-01-01”), “week”) as week – FRIDAY
result "1"
select DATE_PART_MILLIS(MILLIS(“2016-01-04”), “week”) as week – MONDAY
result “1”
Same problem for 2015 year, if you do
select DATE_PART_MILLIS(MILLIS(“2015-01-01”), “week”) as week – THURSDAY
result "1"
select DATE_PART_MILLIS(MILLIS(“2015-01-05”), “week”) as week – MONDAY
result “1”
My assumption is that “week” value is calculated starting 1 January of the year, but not starting Sunday.