Forum Discussion

Dennis_M's avatar
Dennis_M
Cloud Apps
02-20-2025
Solved

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

 

  • Hey 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:

    1. Created Dim Date (Using the Built it Custom Code for 2025 year)
    2. Created additional Custom Table with the Below Syntax

    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

3 Replies

  • AssafHanina's avatar
    AssafHanina
    Sisense Employee

    Hey 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:

    1. Created Dim Date (Using the Built it Custom Code for 2025 year)
    2. Created additional Custom Table with the Below Syntax

    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