Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Selecting in field via button - check multiple fields for same value

Hello,

I'm trying to create a button that will select all records where the same value, say 'abc' is in either of 2 fields. It could potentially only be in 1 of the 2 fields. So in SQL it would be something like this:

select * from table1

where field1 = 'abc' OR field2 = 'abc'.

Any ideas?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

As I understand, "select records" is not the same in this case as "select values in fields".  That is, there should be a record ID that is selected when the condition is met.

See attached.  There is field ID, where the selection is made, and fields F1 and F2.  To select all records where F1=d or F2=d, enter 'd' in the input box (variable vSelecytion), and click on the text box below it.  It has action "Toggle Select".  Look at the search string, all logic is there:


='('&concat({<F1={$(vSelection)}>+<F2={$(vSelection)}>}  distinct ID, '|')&')'

View solution in original post

7 Replies
Anonymous
Not applicable
Author

As I understand, "select records" is not the same in this case as "select values in fields".  That is, there should be a record ID that is selected when the condition is met.

See attached.  There is field ID, where the selection is made, and fields F1 and F2.  To select all records where F1=d or F2=d, enter 'd' in the input box (variable vSelecytion), and click on the text box below it.  It has action "Toggle Select".  Look at the search string, all logic is there:


='('&concat({<F1={$(vSelection)}>+<F2={$(vSelection)}>}  distinct ID, '|')&')'

Christian_Lauritzen
Partner - Creator II
Partner - Creator II

Once again a nice solution, Michael! Like it!

/Christian

Email: christian.lauritzen@b3.se
Not applicable
Author

Hi JO,

Maybe you can try using a Bookmark with your multiple values, then in your button, add an Action "apply bookmark", finally add bookmark ID and taht all.

Best regards.

Not applicable
Author

JO

Your bookmark will store the wild search. So applying a bookmark is a better option.

Regards

Anonymous
Not applicable
Author

Thank you Michael, that's exactly what I was looking for and makes perfect sense!

jazznewbie
Contributor II
Contributor II

Sorry for bumping an old thread. Just wanted to thank for a wonderful solution.

manideep78
Partner - Specialist
Partner - Specialist

Hi @Anonymous 

This is wonderful and I am working on something like this. 

for the same functionality, can I pass same multiple values in input box using delimiter? 

search multiple values in multiple fields with OR 

also, what if I don't have an ID Field?