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: 
Not applicable

set analysis problem

hi, my problem in when i select year=2014 and month=1, i want to get saleQty in year=2013 and month=1(last year current month saleQty). pls help

Labels (1)
1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Check enclosed file...

View solution in original post

9 Replies
MK_QSL
MVP
MVP

SUM({<Year = {'$(=Max(Year)-1)'}>}saleQty)

Not applicable
Author

thanks manish. I missed the Max(). why we use Max() for that?

MK_QSL
MVP
MVP

In case if you have selected 2 or 3 years at a time, we need to tell set analysis that the calculation need to be based on Max Year from the selected.

Not applicable
Author

hi, the result is same as 2014. it s not changing to 2013

Not applicable
Author

No manish, i m only selecting one year at a time. then i want to get last year saleQty

jagan
Partner - Champion III
Partner - Champion III

Hi,

If you have date dimension then try like this

=Sum({<YearDimensionName=, QuarterDimensionName=, MonthDimensionName=,

DateDimensionName={'>=$(=MonthStart(Max(DateDimensionName), -12))<=$(=MonthEnd(Max(DateDimensionName), -12))'}>} Sales)

Regards,

jagan.

Not applicable
Author

Hi jagan, I only have year and month. for an example when i select year=2014 and month=1, i want to get saleQty in year=2013 and month=1(last year current month saleQty). my fields are year, month, saleQty

MK_QSL
MVP
MVP

Check enclosed file...

Not applicable
Author

thanks both of u