Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Pedro_Rodriguez
Contributor III
Contributor III

Filter that applies to 2 fields

Hi all,

Lets say I have this:

Id    Set1    Set2

1      A          B

2                  A

3     B          C

4     A          A 

5     C          D

I'm asked to make a filter that applies to Set1 or Set2, so that if I select 'A' in it, the rows displayed should be:

Id    Set1    Set2

1      A          B

2                  A

4     A          A 

Any ideas?

Thanks a lot in advance.

Labels (1)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@Pedro_Rodriguez    BINGOOOOOO 🤣

finally I have a proposal that can help you:

the idea in expression :

=if(index(purgechar(purgechar(GetFieldSelections(S1)&GetFieldSelections(S2),','),' '),Set1)>0
or 
index(purgechar(purgechar(GetFieldSelections(S1)&GetFieldSelections(S2),','),' '),Set2)>0
,Set1)

attached the Qlikview file :

Capture.JPG

 

Capture.JPG

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

3 Replies
Taoufiq_Zarra

attached qvw file with suggestion

 

Capture.PNG

 

Capture.JPG

 

Regards,
Taoufiq ZARRA

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

(you can mark up to 3 "solutions") 😉
Pedro_Rodriguez
Contributor III
Contributor III
Author

Thanks a lot @Taoufiq_Zarra . I was trying something like: 

1) Create a field called Set contaninig all values from Set1 and Set2, outside the table, to be used as the filter's field (I just want one filter)

2) Then create a new field called SetConcat which is Set1|Set2 (belonging to the table)

3) Then created a trigger asociated to selection action in field Set, which selects *Set* in SetConcat

This works fine, just like your solution, but both have the same problem, you just can select one value in the filter for it to work. When you select 2 or more values it doesn´t work

Please see attached

Taoufiq_Zarra

@Pedro_Rodriguez    BINGOOOOOO 🤣

finally I have a proposal that can help you:

the idea in expression :

=if(index(purgechar(purgechar(GetFieldSelections(S1)&GetFieldSelections(S2),','),' '),Set1)>0
or 
index(purgechar(purgechar(GetFieldSelections(S1)&GetFieldSelections(S2),','),' '),Set2)>0
,Set1)

attached the Qlikview file :

Capture.JPG

 

Capture.JPG

Regards,
Taoufiq ZARRA

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

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