Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
jocampbell
Creator
Creator

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
mov
Champion III
Champion III

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
mov
Champion III
Champion III

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

christianlaurit
Partner
Partner

Once again a nice solution, Michael! Like it!

/Christian

Email: christian.lauritzen@b3.se
Not applicable

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

JO

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

Regards

jocampbell
Creator
Creator
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
Partner

Hi @mov 

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?