Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Today, I've come across an unusual situation: the Week and WeekName functions do not calculate the same week for the same date.
According to the documentation the Week function returns in according to ISO8601, which for today (26/10/17) returns week 43.
The trick situation occurs when I use the WeekName function for the same date, which returns 2017/42.
Hi,
It seems to be a bug. Kindly report to Qlik Support for the same.
Regards,
Kaushik Solanki
Could it be that WeekName returns the week according to your OS settings?
Hi,
Example | Result |
weekname('12/01/2013') | Returns 2013/02. |
weekname('12/01/2013', -1) | Returns 2013/01. |
weekname('12/01/2013', 0, 1) | Returns '2013/02. |
Example | Result |
week( '2012-10-12' ) | returns 41. |
week( '35648' ) | returns 32, because 35648 = 1997-08-06 |
week('2012-10-12', 0, 1) | returns 42 |
Could it be your OS week starts on Sunday?
43 = WeekName(MakeDate(2017,10,26), 0, 0)
42 = WeekName(MakeDate(2017,10,26), 0, 6)
..and your Qlik app week starts on Monday:
Set FirstWeekDay=0;