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: 
psk180590
Creator III
Creator III

Current Week to the Week 2 Years Ago

Hello All,

I have generated the WeekName for each Week in my script and have the Sales values mapped against each week.

Now, in my App i would like to have a chart using Set Analysis and display the results from exactly last 2 years.

Say, the current week is 2018_41. I want the chart to start from 2016_41 to 2018_41 and upon the start of next week 2016_42 to 2018_42.

Thanks

Sai.

Labels (1)
2 Replies
psk180590
Creator III
Creator III
Author

Does anyone has any quick suggestion here. A bit urgent!!

Thanks.

dplr-rn
Partner - Master III
Partner - Master III

2 options

1) use something like below define variables vMaxDate 2018_41 and vMaxDate_Minus2Yrs as 2016_41

Sum( {<OrderDate={"<=$(=vMaxDate) >=$(=vMaxDate_Minus2Yrs)"}>} OrderRecordCounter)

2) in load script create a flag which is mark last 2 years dates based on max date. use that in set analysis. Prefer this one my self