Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
gautik92
Specialist III
Specialist III

Sum for previous year

I have Chart whic am using to compare current year and previous year

my requirement is like if i select some dates in calendar it should show sum for cy and py

for cy it is working fine

am confused with previous year calculation

i should show sum of previous year for those selected dates

4 Replies
Anil_Babu_Samineni

Share me one example please

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Look into As Of Table: The As-Of Table

Anonymous
Not applicable

Hi,

Perhaps something like:

For Current year: =Sum({$<Year={$(=Max(Year))}>}Sales)

For last Year:-=  =Sum({$<Year={$(=Max(Year)-1)}>}Sales)

or alternatively, you can look at this: How to create year to year comparison bar chart?

gautik92
Specialist III
Specialist III
Author

this is to get previous year

but my requirement is lik if i select some dates in calendar i should get sum for same dates in previous year