Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
linoyel
Specialist
Specialist

String variable in match function in expression

Hi, I have a variable vRelevantBusinesses returning me a list of string values of a field "Business":

vRelevantBusinesses_temp: Concat(distinct Business,',')

vRelevantBusinesses: Chr(39) & Replace($(vRelevantBusinesses), ',', Chr(39) & ',' & Chr(39)) & Chr(39)


The vRelevantBusinesses variable output is 'a','b','c'


I need to write set analysis using match function and the vRelevantBusinesses variable output but it doesn't work:

=If(match(Business, $(vRelevantBusinesses)), Business)


Without the variable it works:

=If(match(Business, 'a','b','c), Business)


Please help on getting this to work: =If(match(Business, $(vRelevantBusinesses)), Business)


Sample app is attached.


Thanks!

13 Replies
pradosh_thakur
Master II
Master II

pfa

=chr(39) & concat(distinct Business,chr(39)&','&chr(39)) & chr(39) as variable.

https://community.qlik.com/blogs/qlikviewdesignblog/2014/11/24/the-equal-sign

a good read

regards

Pradosh

Learning never stops.
sunny_talwar

Or you can use an equal sign with your variable like this

=chr(39) & concat(distinct Business,chr(39)&','&chr(39)) & chr(39)

and then this

=If(match(Business, $(=vRelevantBusinesses)), Business)

linoyel
Specialist
Specialist
Author

Thanks, that's worked

linoyel
Specialist
Specialist
Author

Thank you!