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: 
qlikviewaf
Creator
Creator

Last Year

Hi Guys,

on my app i select Year/Month to see the sales.

I would like also to retrieve the sales for the same month of last year.

There's a way to say in the formula to keep data of last year based on the year selected?

So if i select 2017 the formula will retrive 2017-1= 2016 ? Is something possible?
Thanks

sum({<Area-={'Area-not-available'}>}ExtendedUSD),

4 Replies
sunny_talwar

May be like this

Sum({<Area-={'Area-not-available'}, Year = {$(=Max(Year) - 1)}>}ExtendedUSD)

its_anandrjs

You can try this way

Current Year

sum({<YearField = {"$(=Max(YearField))"},  Area-={'Area-not-available'}>}ExtendedUSD)


Previous Year

sum({<YearField = {"$(=YearField-1)"},  Area-={'Area-not-available'}>}ExtendedUSD)


Or


sum({<YearField = {"$(=Max(YearField)-1)"},  Area-={'Area-not-available'}>}ExtendedUSD)

qlikviewaf
Creator
Creator
Author

Tried without success

May+June 2017 = 2986 , formula is ok

May+June 2016, selecting 2017 as year doesn't give me 3247 which is the value expected

Can you kindly check my dashboard ?

Thank you !

sunny_talwar

May be you forgot to add other set analysis

=Sum({<Year = {"$(=Max(Year)-1)"},  Area -= {'Area-not-available'}, Item_Category ={$(vNoInstruments)}>} ExtendedUSD)/1000


Capture.PNG