Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
inescastelhano
Partner - Creator II
Partner - Creator II

Chart is not ignoring selection

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.

qlik.png

If I select 2015 and 2016, it shows as follows (this is what i want, even having only 2016 selected - I want ALL years):

qlik2.png

I don't know how to make the chart to show all years. Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar

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

View solution in original post

16 Replies
trdandamudi
Master II
Master II

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

sunny_talwar

Would you be able to share a sample to look at the issue?

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Does not work

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Here it is.

sunny_talwar

I am seeing this without selection. Is this not what you are seeing?

Capture.PNG

jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Alternatively, enclose the Aggr() in another function that overrides the year selection.

Sum({<Year>} if(Aggr(......)))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
inescastelhano
Partner - Creator II
Partner - Creator II
Author

Yes, but that's because nothing is selected.

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Sorry, I don't get it. Could you please write the entire expression? Thank you!