Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have a qlik dashboard where i have the following data:
Client Unit Value Year
1 A 30 2016
1 B 30 2016
1 C 10 2016
2 A 10 2016
2 B 15 2016
2 C 25 2016
3 A 25 2016
3 B 25 2016
3 C 15 2016
1 A 40 2015
1 B 40 2015
1 C 20 2015
...
I want to have a chart displaying: for each client, the unit with the greatest value (and respective value), per year.
The expression I'm using is:
if(aggr(rank(Max({<[Flag_doesn't_matter]={T}>}Value))<=1,[Client],Year,[Unit]),
sum({<[Flag_doesn't_matter={T}>}Value))
and my dimensions are: Client, Year, Unit.
However, my chart shows as follows, which means, it does not consider all years if i don't have all the years selected. At the moment, only 2016 is selected.
If I select 2015 and 2016, it shows as follows (this is what i want, even having only 2016 selected - I want ALL years):
I don't know how to make the chart to show all years. Thanks in advance.
Try this:
If(Only({<Year>}Aggr(Rank(Max({<[Flag_doesnt_matter]={T}, Year>}Value))<=1,[Client],Year,[Unit])),
Sum({<[Flag_doesnt_matter]={T}, Year>}Value))
This will ignore any selections in Year field
Give a try with the below:
if(aggr(rank(Max({1<[Flag_doesn't_matter]={T}>}Value))<=1,[Client],Year,[Unit]),
sum({<[Flag_doesn't_matter={T}>}Value))
Would you be able to share a sample to look at the issue?
Does not work
Here it is.
I am seeing this without selection. Is this not what you are seeing?
The Aggr() function also responds to current selections, so the data is already reduced to the selected year before the year override is applied.
Do you really need the Aggr() here? If you modify the expression to avoid using Aggr, then you will be able to see all years.
Alternatively, enclose the Aggr() in another function that overrides the year selection.
Sum({<Year>} if(Aggr(......)))
Yes, but that's because nothing is selected.
Sorry, I don't get it. Could you please write the entire expression? Thank you!