Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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.

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