Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I am trying to show on my Qlik Sense app , in a bar chart, the total income compare to the previous year.
the dim is : product name
the measures :
finding the last year that had a sale in this product: Sum({$<[SaleYear]={$(=Max([SaleYear]))}>} [Total income])
finding the previous year: Sum({$<[SaleYear]={$(=Max([SaleYear])-1)}>} [Total income])
I have couple of problems:
1) Not all the product had started to sale on the same year , f or eample: product A sold in :2005,2006,2007 - so in my bar chart I want to see in the bars only the totoal income of 2007 and 2006(the previous year), product B sold in : 2004,2005 - so in my bar chart I want to see the bars only of 2005 and 2004(the previous year).
So in the Legend in the bar chart , I need to have all the years that are possible :2004-2007, and in every product in the bar chart there will be only 2 bars .
2) the Lable of each expression can't calculate the values:
=Max([SaleYear])
=Max([SaleYear])-1
it's just show the string I wrote.
thanks for your help
1) Try these:
FirstSortedValue(Aggr(Sum([Total income]), [product name], [SaleYear]), -Aggr([SaleYear], [product name], [SaleYear]))
FirstSortedValue(Aggr(Sum([Total income]), [product name], [SaleYear]), -Aggr([SaleYear], [product name], [SaleYear]), 2)
2) Even if Qlik Sense allowed to show Max([SalesYear]), which year would you have seen 2007 for Product A or 2005 for Product B as the max year?
1)Thanks for your answer, but it did not worked- I attached the project to my original question, so you can look at it .
2) They want to know how these products perform compared to the previous year- that is what they asked me to show.
so I guess that there will be different maxYear for each product.- am I right ? did I understand what they asked correctly ?
thanks
Moni
I don't see anything attached. Can you check
Soory , I had problems loading .
So I load it to the web , just download it from here :
http://www.filedropper.com/test_73
Thanks again
Moni
Soory , I had problems loading .
So I load it to the web , just download it from here :
http://www.filedropper.com/test_73
Thanks again
Moni