function week() can deliver different results depending on the "FirstWeekDay" setting
Article Number: 000075443 | Last Modified: 2019/05/24
Description
Description:
Please note that the function week() can deliver different results depending on the setting for the "FirstWeekDay".
Example 1:
1) Open the Data Load Editor in Qlik Sense and make sure that you have the setting "SET FirstWeekDay=0;" 2) Add the following code: "let test = week(makedate(2019,5,12));" 3) Check the output of the variable "test" --> it should be 19.
Example 2:
1) Open the Data Load Editor in Qlik Sense and make sure that you have the setting "SET FirstWeekDay=6;" 2) Add the following code: "let test = week(makedate(2019,5,12));" 3) Check the output of the variable "test" --> it should be 20.
Cause
Cause:
This behavior is working as designed.
Please note that the 12th of May (makedate(2019,5,12)) is a Sunday and depending if you FirstWeekDay=6 or FirstWeekDay=0 you define the first day of the week as Sunday or Monday which leads to the provided results 20 or 19.
For more information please check the help page: https://help.qlik.com/en-US/sense/April2019/Subsystems/Hub/Content/Sense_Hub/Scripting/NumberInterpretationVariables/FirstWeekDay.htm
Get Answers
Find Answers
Qlik Community
Collaborate with over 60,000 Qlik technologists and members around the world to get answers to your questions, and maximize success.
Experiencing a serious issue, please contact us by phone. For Data Integration related issues please refer to your onboarding documentation for current phone number.