WEEKOFYEAR Function - Change Start of Week to Friday from Monday at Calculated Col Level
Hello Sisense Community,
I would like to change Start of Week on "WEEKOFYEAR" function to Friday from default Monday at the column level (not at general server config settings).
Is there a standard formula available? Thanks, - Dennis
Dennis_M
Posted 1 year ago · Edited 1 year ago·Last reply 1 year ago
3 comments
Assaf Hanina
·1 year ago · EditedHey Dennis_M ,
As the "WEEKOFYEAR" Started on Monday you can add additional function of ADDDAYS to consider Friday's only within the "WEEKOFYEAR" formula.
In the current approach, weekofyear(dd.[Date]) starts from Monday. Instead, by using the ADDDAYS function, the formula is modified to: weekofyear(adddays(dd.[Date], -4)), shifting the week start to Friday.
See Example:
Note - Not Sure what is the intended for The Weeks between the Years (with the new year the week start from 52) but it can customize as well according to your needs
I hope this helps to resolve the issue
best regards
Dennis_M
OP1 year agoTHANK YOU Assaf! Your simple solution is exactly what I was looking for. - D
Assaf Hanina
·1 year agoyou are welcome Dennis_M