Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ghermann
Contributor II
Contributor II

Problem with 31.12.2018: week(31.12.2018) = 1 but year (31.12.2018) = 2018

Hello,

I have "date" fields in the format dd.mm.yyyy. I use this field for dimensions in charts.

Example 1:
1st Dimenstion:

=week(date)

2nd Dimension:

=year(date)

 

Example 2:
Dimension:

=year(date)&num(week(date),'_00')

 

Now the Problem:
For the date="31.12.2018" the function week(date) delivers correct "1" but the function year(date) delivers "2018". Of course this is correct, but not helpful.

Any ideas?

Regards
 Georg

Labels (3)
1 Solution
4 Replies
ghermann
Contributor II
Contributor II
Author

Thanks for the note!

If I set "BrokenWeeks=1", week (31.12.2018) returns 53 and the charts look meaningful again.
Unfortunately there is no week 53 in 2018. All other calendars say that 31.12.2018 belongs to the first week of 2019.
So "BrokenWeeks=1" is just an ugly workaround that does not fit with other systems.

ghermann
Contributor II
Contributor II
Author

Thanks for the outstanding hint! You saved my day 😉