I want to add “Weeknumber” to my “Day” dimension.
Since WEEKNUM() is not available, I want to use the equivalent of SHIFT/PREVIOUS to calculate the weeknumber.
I have a dimension called Weeknumber (1-53), and would like to do something along the following line, in order map Days → Weeknumbers:
//Check if first day of year,
// Else: check if workday = Monday then add 1 to week count
IF(Day.'Day of Week' = 'Day of Week"."Monday",
//IF NOT Monday, then keep current weeknum
However, both PREVIOUS and SHIFT does not seem to work. Is there a workaround?
Best answer by Issam MoallaView original