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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis -- LastYear/LastMonth

Hi...

I would like when I click on Year on my selection List Sum Qty for year = Year-1  and Month = Month(Max(Month)-1)

Example : I clik on Year = 2012 [2011 -- NOV.] (selection list)

I obtain a calculation like : Sum (Qty) for {Year=2011;nov.} in dynamic.

Labels (1)
3 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

for the whole last year  use

sum({<Year={"$(=max(Year)-1)"}, Month=>} Qty)

for same month in last year use

sum({<Year={"$(=max(Year)-1)"}>} Qty)

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use set analysis for this type of problem.

     =Sum({<Year={$(=Max(Year)-1)},Month={'$(=if(GetSelectedCount(Month)>0,Month(AddMonths(Max(Date),-1)),'*'))'}>} Qty)

Hope it helps

Celambarasan

Not applicable
Author

Thank you. I'll test it !!