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: 
Not applicable

Working with calendar weeks

Hi,

Can you please help me to fix this issue :

I have a list of calendar weeks in this format YYYYWW stored in a calendar table :

201301, 201302 , ...., 201324

And i want to get in the same format the last n weeks.

For example:

If i choose the 201304 and n= 6 weeks

I have to get this :

201303 201302 201301 201252 201251 201250

Thanks in advance

Labels (1)
1 Reply
alexandros17
Partner - Champion III
Partner - Champion III

You need 6 (n) variables,

the first one is

=if(right(GetFieldSelections(week)-1,2)='00',

(
left(GetFieldSelections(week),4)-1)*100+52,

GetFieldSelections(week)-1

)

other 5 are the same