Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
kashjaniqlik
Contributor III
Contributor III

Passing a variable in wildmatch

Hello

I have a list of values loaded in a temp table from an excel file. I would like to pass these values to wildmatch function through a variable. Is this possible in Qlikview?

Thanks in advance.

e.g.

List of Values

ABC

DEF

GEH

I'd like to store these values in a variable and pass that variable (with a complete list) to wildmatch function.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

SET vList = '*ABC*','*DEF*','*GEH*';

Wlidmatch(MyField, $(vList));


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

SET vList = '*ABC*','*DEF*','*GEH*';

Wlidmatch(MyField, $(vList));


talk is cheap, supply exceeds demand
kashjaniqlik
Contributor III
Contributor III
Author

Many Thanks Gysbert. This really helpful.

Can we move the list to excel and load the values from excel in to the variable please?

Gysbert_Wassenaar

Yes. Load the list from excel and use the concat function to create a list:

temp:

LOAD concat( chr(39) & MyValue & chr(39) , ',') as List FROM ...excelfile...

LET vList = peek('List',-1,'temp');

DROP TABLE temp;


talk is cheap, supply exceeds demand
kashjaniqlik
Contributor III
Contributor III
Author

Thanks again Gysbert. Almost there - although chr(39) is returning double quotes instead of single quotes and this messes my wildmatch function. any ideas please?

Gysbert_Wassenaar

That's not possible. Chr(39) will return a single quote. Chr(34) returns a double quote.


talk is cheap, supply exceeds demand
kashjaniqlik
Contributor III
Contributor III
Author

That's fine Gysbert. I have had some issues with my excel file. Thanks for your help.