Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

dirkmathias
New Contributor II

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

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

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
Valued Contributor III

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

Try this.


Table1:

LOAD

KVNr

FROM

H:\Test_Filter.xls

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


SELECT *

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

dirkmathias
New Contributor II

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

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

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

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

Thanks,

Lavnaya