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

Filter on 2 different dimensions

I want to create a filter where it will return all results in a table based on whether the value exists in columns A or B.  I am not looking to hard code the values in the scripts because I have thousands of rows in the table.

So if I filter for apple, it should return rows 1 & 3.  

RowField AField B
1appleorange
2pear 
3orangeapple
4banana 
5peachbanana
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

You should create that search field in script to make it more optimized.

So your script should have one more table that is connected to the main table, like below.

Main:

Load *,FieldA&'-'&FieldB as Key from xyz;

SearchTable:

Load Distinct FieldA&'-'&FieldB as Key, FieldA as Search Field From XYZ;

Concatenate

Load Distinct FieldA&'-'&FieldB as Key, FieldB as Search Field From XYZ;

 

Now you should make selection in Search Field which will eventually select both the rows as per your example.

 

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

You should create that search field in script to make it more optimized.

So your script should have one more table that is connected to the main table, like below.

Main:

Load *,FieldA&'-'&FieldB as Key from xyz;

SearchTable:

Load Distinct FieldA&'-'&FieldB as Key, FieldA as Search Field From XYZ;

Concatenate

Load Distinct FieldA&'-'&FieldB as Key, FieldB as Search Field From XYZ;

 

Now you should make selection in Search Field which will eventually select both the rows as per your example.

 

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sharon9
Contributor II
Contributor II
Author

Thank you Kaushik.  That worked great!