Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calendar week / year problem

Dear all,

I am looking for a way to display the correct year according to a calendar week (cw) based on a date.

Solution has to be ISO 8601 conform.

Current Script:

week(myDate) & ' / ' & year(myDate)

Example:

01. Jan 2008 --> 01/2008 --> correct

01. Jan 2010 --> 52/2010 --> wrong! should be 52/2009!

31. Dec 2007 --> 01/2007 --> wrong! should be 01/2008!

Any ideas / hints how to solve this?

Many thanks in advance

Labels (1)
1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II

Hi qv..

Try this:

New Script:

week(myDate) & '/' & weekYear(myDate)

hth/gg

View solution in original post

3 Replies
gandalfgray
Specialist II
Specialist II

Hi qv..

Try this:

New Script:

week(myDate) & '/' & weekYear(myDate)

hth/gg

its_anandrjs
Champion III
Champion III

Hi,

I think you have to use

week(myDate) & '/' & YearEnd(myDate)

HTH

Regards

Anand

Not applicable
Author

Hi gg,

this is awesome...

It costs me half a day to try it by my own and 6 minutes to figure out that it was directly in front of me the whole time!

many thanks!