Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Expression YOY

Hi,

We have used the below logic to get last year MTD sales.(Ex:2015,Dec 1 to 13 sales).

Here i need to calculate previous year sales(Ex:2015,Dec 1 to 13 sales)

Logic to get 2015 DEC MTD sales :

sum({$<Year = {$(=max(Year)-1)},Month = {"<=$(=max({<Year={$(=max(Year))}>}Month))>$(=max({<Year={$(=max(Year))}>} Month)-1)"},      [Reported Date] = {"<=$(=addyears(max([Reported Date]),-1))"},[Current Sales Class Nbr]  = {001}>} TOTAL ([Invoice Merchandise Amt] + [Invoice Price Concession Amt]))

Reported Date format ='MM/DD/YYYY'

Please provide the logic to get 2014 sales.

Thanks..

1 Reply
adamdavi3s
Master
Master

Firstly I would highly recommend using a flag in the calendar to generate this sort of thing, it makes life a lot easier!

I think these are the only two places you need to change it but my brain isn't totally up to speed today

sum({$<Year = {$(=max(Year)-2)},Month = {"<=$(=max({<Year={$(=max(Year))}>}Month))>$(=max({<Year={$(=max(Year))}>} Month)-1)"},      [Reported Date] = {"<=$(=addyears(max([Reported Date]),-2))"},[Current Sales Class Nbr]  = {001}>} TOTAL ([Invoice Merchandise Amt] + [Invoice Price Concession Amt]))