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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis for calculating Growth YoY

Hi,

I have a list box of year and month, on selecting for example February 2014 and March 2014 , it should show me (sum of sales in Feb +March2014  ) -(sum of sales in Fwb +March2013 ) for the previous year. how do i write set analysis expression for it. Also, is there any reference where i can learn to write these expressions and get a know about functions used in qlikview.

Thanks in advance.

10 Replies
Not applicable
Author

hi

create variable like this:---

vMaxYear =max(Year)

vPriorYear =vMaxYear -1

vMaxDate =max(Date)

vMinDate =min(Date)

vPriorYearDate_max  =date(addyears(max(Date), -1), 'DD MMM YYYY')

vPriorYearDate_min  =date(addyears(min(Date), -1), 'DD MMM YYYY')

then try this

= SUM({<Year={'$(vMaxYear)'},Date={'>=$(vMinDate)<=$(vMaxDate)'},Month= >}Sales)

-

SUM({<Year={'$(vPriorYear)'},Month=,Date={'>=$(vPriorYearDate_min)<=$(vPriorYearDate_max)'}>}Sales)