Hi!
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,
IF(
LEFT(Day.'dd-MM-YYYY',5)="01-01" ,
ITEM(1,Weeknumber.Week),
// Else: check if workday = Monday then add 1 to week count
IF(Day.'Day of Week' = 'Day of Week"."Monday",
PREVIOUS(Day.Weeknumber)+1,
//IF NOT Monday, then keep current weeknum
PREVIOUS(Day.Weeknumber))
However, both PREVIOUS and SHIFT does not seem to work. Is there a workaround?