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

Filtering different columns in OR/AND

Hi! 

In Qlik sense is possible to have some user filters working in OR  instead off AND?

For exemple, see this table:

id | Country | Year

0 | US | 2020

1 | US | 2021

2 | JP | 2020

3 | IT | 2019

If i create two filter for Country and Year and Choose US as Country then the Year Filter will show only 2020 and 2021 as choosable, 2019 wolud be in gray and if i choose it it will disable the Country Filter and show me only IT in Country Filter.

 

I'm asking if there is a way for filter US on Country OR Year = 2019, so i'll see the record with ID 0,1 and 3.

 

Is a manageble issue?

 

Thanks

 

Labels (3)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@simoj89  Maye be you can use data island as :

in the load script for example for this sample you can add :

Data:
load * inline [
id,Country,Year
0,US,2020
1,US,2021
2,JP,2020
3,IT,2019
];

Country:
load Country as FilterCountry resident Data;

Year:
load Year as FilterYear resident Data;

then create new filtre FilterYear and rename Year

create new filtre FilterCountry and rename it Country

Finaly create new filtre as :

=aggr(Only({<Country={$(=chr(39)&GetFieldSelections(FilterCountry,chr(39)&','&chr(39))&chr(39))}>+<Year={$(=chr(39)&GetFieldSelections(FilterYear,chr(39)&','&chr(39))&chr(39))}>} id),id)

and rename it id

the output:

Taoufiq_Zarra_0-1614075830706.png

 

Taoufiq_Zarra_1-1614075851650.png

 

Taoufiq_Zarra_2-1614075870466.png

 

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra

@simoj89  Maye be you can use data island as :

in the load script for example for this sample you can add :

Data:
load * inline [
id,Country,Year
0,US,2020
1,US,2021
2,JP,2020
3,IT,2019
];

Country:
load Country as FilterCountry resident Data;

Year:
load Year as FilterYear resident Data;

then create new filtre FilterYear and rename Year

create new filtre FilterCountry and rename it Country

Finaly create new filtre as :

=aggr(Only({<Country={$(=chr(39)&GetFieldSelections(FilterCountry,chr(39)&','&chr(39))&chr(39))}>+<Year={$(=chr(39)&GetFieldSelections(FilterYear,chr(39)&','&chr(39))&chr(39))}>} id),id)

and rename it id

the output:

Taoufiq_Zarra_0-1614075830706.png

 

Taoufiq_Zarra_1-1614075851650.png

 

Taoufiq_Zarra_2-1614075870466.png

 

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
simoj89
Contributor II
Contributor II
Author

Seems to work well! 

 

Great!