Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

max year to last three yr sales

Hello All,

As i got couple of years data and i am trying to get sales in between max(year ) to previous 3 year ,

the expression that i wrote in my bar is this

sum({1<Year007={">=$(=Year(YearStart(max(Year007),-3)))<=$(=max(Year007))"}>}Sales007)

which is not bring me an appropriate output so definately i made a mistake but as for my knownledge the expression look pretty ok ,

please can any one suggest me what wrong with this expression ./..thanking you in advance

kumar

4 Replies
Anonymous
Not applicable

try this:

=sum({<Year007={'>=$(=max(Year007)-3)'}>} Sales007)


Agreed with Peter, try this:


=sum({<Year007={'>=$(=max(Year007)-3)<=$(=max(Year007))'}>} Sales007)


Note: I hope Year007 contains value like 2012,2013,2015 etc


Not applicable

HirisH_V7
Master
Master

Hi,

If your data contains till today and real time approach will be like this,

Sum({<Year=, Quarter=, Month=, Week=, Date={‘>=$(=YearStart(Today(), -3))<=$(=Today())’}>} Sales )



or else with your Date field ,



Sum({<Year=, Quarter=, Month=, Week=, Date={‘>=$(=YearStart(Max(Date), -3))<=$(=Date(Max(Date)))’}>} Sales )


else year field,check this,


N-period rolling data, moving average, easy solution.



Hope this helps,

Regards,

HirisH

HirisH
“Aspire to Inspire before we Expire!”
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Watch out, Balraj. there is no upper limit in your set analysis. A set modifier will start from all values in Year007 and therefor will include 2000-2015 if you select for example 2003 in Year007.