Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
vlad_komarov
Partner - Specialist III
Partner - Specialist III

Construct a string to select multiple values by "Select In Field" action

Hello!

I need to select multiple values in a field using "Select In Field" action. I need to find a way to construct a string for that purpose using a proper values separator.

It works perfectly for single selection: (select the value in ACCOUNT_TYPE field based on the selection in ACCOUNT_TYPE_ABBREV field😞

[Select In Field]  -->  Field=ACCOUNT_TYPE --> Search String =GetFieldSelections(ACCOUNT_TYPE_ABBREV, '!')

I've tried multiple values separators (the second parameter in GetFieldSelections() function above), but without much success.

I would appreciate any suggestion.

Best regards,

Vladimir

Labels (1)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

define a variable v

='(' &

concat('"' & ACCOUNT_TYPE_ABBREV & '"', '|')

& ')'

select in field

='$(v)'

View solution in original post

6 Replies
swuehl
Champion III
Champion III

maxgro
MVP
MVP

define a variable v

='(' &

concat('"' & ACCOUNT_TYPE_ABBREV & '"', '|')

& ')'

select in field

='$(v)'

vlad_komarov
Partner - Specialist III
Partner - Specialist III
Author

Swuehl,

I've tried that '(AAA|BBB)' option, does not work directly.

But Massimo's suggestion (below) seems to be working in my case.

Thanks!

VK

vlad_komarov
Partner - Specialist III
Partner - Specialist III
Author

Massimo,

Thanks, it seems to be working in my case.

The only concern will be a performance issue (using "concat()" ....) since I have to repeat this technique on multiple fields.

But thanks for great suggestion!

Regards,

Vladimir

swuehl
Champion III
Champion III

I assume your values contain spaces. If so, you would need to use quotes:

("AA A"|"BB B")

vlad_komarov
Partner - Specialist III
Partner - Specialist III
Author

Yes, using double quotes helped a bit

I am using composite values separator ["|"], so the final variable looks like:

= '("' & getFieldSelections(ACCOUNT_TYPE_ABBREV, '"|"') & '")'

And it seems to work faster than Concat().

Thanks!

VK