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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
chriys1337
Creator III
Creator III

Leading Zero for Calendarweeks

Hi all,

I am generating a Year & Calendarweek Field with the help of my date field

From week 1-9 the leading Zero is missing, which I need and I am adding it artificially with following expression:

weekYear(Date) & if(len(Week(Date))=1,0 & Week(Date),Week(Date) )) as Year_Week

Now I wonder, if there is a better way to force QlikView to put a leading Zero to the Week String?

Thanks for your help!

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try like:

Num(Week(Date),'00') as TwoDigitWeek

View solution in original post

2 Replies
tresB
Champion III
Champion III

Try like:

Num(Week(Date),'00') as TwoDigitWeek

chriys1337
Creator III
Creator III
Author

Thank you, I tried it with num(Week(date),'##') but this did not work....