Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Select ... where field in (csv or txt file)

Hello,

i load values from a csv or txt file.

these values ​​are used as a filter to load data from sql server

example:

Table1:

LOAD

KVNr,     

FROM

H:\Test_Filter.xls

(biff, embedded labels, table is Sheet1$);

Table2:

SQL SELECT *

FROM "MiamiCRM".dbo.Mitglieder where KVNr in(Table1);

how can i do this ?

4 Replies
Not applicable
Author

Hello,

Please try this...

Table1:

LOAD

KVNr,     

FROM

H:\Test_Filter.xls

(biff, embedded labels, table is Sheet1$);

Table2:

SQL SELECT *

FROM "MiamiCRM".dbo.Mitglieder where exists(KVNr,Database_field);

Here just include the name of the Database_field in the where clause.. Database_field is nothing but the field which resembles  same as the KVNr..

nagaiank
Specialist III
Specialist III

Try this.


Table1:

LOAD

KVNr

FROM

H:\Test_Filter.xls

(biff, embedded labels, table is Sheet1$);


SELECT *

FROM "MiamiCRM".dbo.Mitglieder where exists(KVNr);

Anonymous
Not applicable
Author

Thanks. So it doesnt work. But i solved the problem with your "exists".

Filter:

LOAD ID

FROM H:\Filter.xls (biff, embedded labels, table is Sheet1$);

Mitglieder:

LOAD

ErstBeginn,

EUVSNR,   

GebDat,   

KassenID,   

KVNr,

KVNR2005,

KassenID&KVNr as ID,   

MGID,  

Name,   

PLZ,   

Strasse,

VersArt,

Vorname,

VSNR,

VWStelle,

Wohnort where exists (ID,KassenID&KVNr);

SQL SELECT

ErstBeginn,

EUVSNR,   

GebDat,   

KassenID,   

KVNr,

KVNR2005,   

MGID,  

Name,   

PLZ,   

Strasse,

VersArt,

Vorname,

VSNR,

VWStelle,

Wohnort

FROM "CRM".dbo.Mitglieder;

Not applicable
Author

I hope I have given the same solution that you have implemented. Anyway nice to hear that your problem is resolved.

Thanks,

Lavnaya