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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
STheiß1701766530
Contributor
Contributor

use content of an excel file in a condition in a sql statement

hello,

I want to read country names from a simple xslx file (just one column with the names of the countries) and use this content as a condition in a sql statement which I use in a tMSSQLInput.

the sql statement would look like this:

select * from Table1 where

countryNames in ( "content of the xlsx file")

I have tried a few things, such as tBuffer, but i don't know how to save the content of the file and use it in the the where-clause of the tMSSQLInput component.

Can you kindly help me here?

Thank you!

greets from Germany

Labels (2)
1 Reply
Anonymous
Not applicable

Hello,

If we understand your requirement very well, you could use context variable in the SQL query.....

"SELECT *

FROM TABLE

WHERE countryNames = " +context.YourContext(content of the xlsx file)

The Job looks like:

tFileInputExcel--main(row1)--tFlowToIterate--iteate--tJava--oncomponnetOK-->tMSSQLInput--main-->other components

on tJava:

context.countryNames=row1.countryNames;

Feel free to let us know if it is OK with you.

Best regards

Sabrina