Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading a list of values from Excel to Variable

Hello QV Community:

Appreciate if someone can kindly help me with the following problem I have:

I have a list of values in Excel (like snap shot below) and I would like to pass these values as parameters

in a script under the "Where" statement like:

Load * from Customer.Table

Where

match(Customer.ID,'A010006','A080478','A082780','A0978256','C088897')

excel.gif

thanks in advance

Kumar

5 Replies
sunny_talwar

May be use where exist instead:

FieldCheck:

LOAD Family

FROM source;

LOAD Customer.ID,

          OtherFields

FROM

Where Exists (Family, Customer.ID)

rubenmarin

And if you want to use in a SQL Select you can load those in a variable:

LOAD Chr(39) & Concat(Familia, Chr(39) & ',' & Chr(39)) & Chr(39) as FamilyFilter;

LOAD Family

FROM [...xlsx] ....;

LET vFamilyFilter = FieldValue('FamilyFilter', 1);

Then you can use it in the where:

SELECT ... FROM ...

WHERE Family IN ($(vFamilyFilter));

Not applicable
Author

Thanks Sunny, your suggestion worked !!!

sunny_talwar

Awesome

Not applicable
Author

Thanks Ruben, your suggestion worked too!