Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

comparing years

hey everyone,

i am creating a sale report and i am trying to compare sales between years:

my sales field = SUM(NIS_TOTPRICE)

and year = Year,

can someone please help me?

17 Replies
brunobertels
Master
Master

ok sorry to read that

can you share a sample of your data or the qvf

Regards

Bruno

Not applicable
Author

ofcurse what is your mail?

brunobertels
Master
Master

you can upload your app here

clic on advance user editor and join link

or send me it bruno.bertelsatcegetel.net ( change at by @)

Bruno

Not applicable
Author

brunobertels
Master
Master

Thanks for sharing

At the end it's working

see below

ILS Total give the whole total for all the years and total for a selected year

Set analysis ( Year) i changed it like that : Num(sum ({$<year={}>}NIS_TOTPRICE))

but as is this formula is wrong because "year" here is interpreted as qlik syntax keyword (blue) and not like a dimension.(orange)

so without year selection it gives you the same result as ILS Total

selecting a year it will give you the total for the year selected

          if ever you always want the total even if a year is selected use this :

          Num(sum ({<YEAR=>}NIS_TOTPRICE))

PAST YEAR i changed it like that :  sum ({$<YEAR={'$(=max(YEAR-1))'}>}NIS_TOTPRICE)

so without any year selection it will give you the total for 2013 if your data end in 2014 and so on

selecting a specific year eg: 2010 , it will give you the total for 2009 etc

i can't send you back your modified app for it is two heavy to upload it

hope it is what you need especialy for PAST YEAR

Bruno

Not applicable
Author

Bruno thank you very much!!!

you helped me  alot!!


Not applicable
Author

Hey Bruno is there is a chance you can help me figure out why this if condition doesn't work?

if sum({$<YEAR={'$(=max(YEAR-1))'}>}RIV_QUANT)>0 and sum({$<YEAR={'$(=max(YEAR-1))'}>}NIS_TOTPRICE)>0 and (sum ({$<Year={'YEAR'}>}RIV_QUANT))<1 and (sum ({$<Year={'YEAR'}>}NIS_TOTPRICE))<1,

(sum ({$<Year={'YEAR'}>}NIS_TOTPRICE))

RIV_QUANT= quantatiy

NIS_TOTPRICE=SALES

brunobertels
Master
Master

Hi

Sorry i don't know how to achieve this.

Your mesure seems wrong and should be :

if (

sum({$<YEAR={'$(=max(YEAR)-1)'}>}RIV_QUANT)>0

and sum({$<YEAR={'$(=max(YEAR)-1)'}>}NIS_TOTPRICE)>0

and sum ({$<YEAR={'$(=max(YEAR))'}>}RIV_QUANT)<0

and sum ({$<YEAR={'$(=max(YEAR))'}>}NIS_TOTPRICE)<0,

sum ({$<YEAR={'$(=max(YEAR))'}>}NIS_TOTPRICE),0)

I tested it but it does'nt work. I'am not sure If & And are the solution here.

Good luck and let me know if you find a solution , I am a little bit curious on how it can be solved.

bruno