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: 
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),

Labels (1)
4 Replies
sunny_talwar
MVP
MVP

May be like this

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

its_anandrjs
Champion III
Champion III

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
MVP
MVP

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