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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
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.

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 !!