Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
AnshulKaaz
Contributor II
Contributor II

Using If() in filter to select a conditional dimension

HI There,

First let me appreciate you for taking the time out for this issue.

Now coming to the question:

I have the below data:

T1:

Load * inline [

Company,Region,CountryID,Status

A,USC,2,1

B,EMEA,5,1

C,Asia,1,1

D,Asia,6,0

E,Africa,4,0

F,Europe,2,1

];

 

T2:

Load * inline [

CountryID,Country

1,US

2,Germany

3,India

4,South Africa

5,Egypt

6,Japan

];

 

I have a filter as : If(Status = 1,Country)

It give me an option to select Germany , US and Egypt, which was expected.

When I select a value, say germany, two filters are applied simultaneously :

1. Status = 1 

2. Country = Germany

 

I only need that The country filter is applied and not the status.

 

1. Can you please explain the working here. Why 2 filters are applied?

2. How can I modify the filter to get what is needed? That  is only country filters.

Labels (1)
1 Reply
brunobertels
Master
Master

Hi 

As you use an if statement in your filter pane this is a normal behavior of Qliksense if you use this expression 

If(Status = 1,Country) in this case you select Status = 1 , then relevant Country 

you may have this : here status 1 is selected ( in green) 

brunobertels_0-1694012735059.png

 

change your mesure by this one : 

=aggr(If(Status = 1,Country),Country)

then you will have this : ( status is prefiltered with possible value in white and exclude value in grey)

brunobertels_1-1694012839552.png

 

Hope it helps