Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Partner
Partner

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

1 Solution

Accepted Solutions
MVP
MVP

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

define a variable v

='(' &

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

& ')'

select in field

='$(v)'

View solution in original post

6 Replies
MVP
MVP

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

MVP
MVP

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

define a variable v

='(' &

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

& ')'

select in field

='$(v)'

View solution in original post

Partner
Partner

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

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

Partner
Partner

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

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

MVP
MVP

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

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

("AA A"|"BB B")

Partner
Partner

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

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