Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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)