Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using table/fields from a load in a select §SQL

Hi,

I have a script to load data fron an excel files :

Directory;

commesse_clienti :

LOAD Cod_interno, ragsoc_chiamata, cliente_chiamata, coddest_chiamata, commessa_chiamata

FROM elenco_cli_com.xls (biff, embedded labels, table is Foglio1$);

and then i would to use this in a SQL statement SQL server ( sfter a connection ODBC ...)

...

SELECT *

FROM CHIAMATE

WHERE cliente in

( SELECT cliente_chiamata FROM commesse_clienti);

How can i do ??

Thanks





1 Solution

Accepted Solutions
amit_shetty78
Creator II
Creator II

You may also try using the following sample using INNER JOIN. This will load only the data from both tables that have matching sKey value.


Table1:
LOAD sKey,
Tab_Field1
FROM [Sample Data.xls] (biff, embedded labels, table is Sheet1$);

INNER JOIN (Table1)
LOAD sKey,
Tab2_Field1,
Tab2_Field2,
Tab2_Field3,
Tab2_Field4;
ODBC CONNECT TO sqlDatasource;
SQL SELECT *
FROM sqlDatasource.dbo.Tab2;


View solution in original post

2 Replies
Not applicable
Author

Hi,

an idea is to have a preceding LOAD combined with WHERE EXISTS (FieldName):

Test:
LOAD * Where Exists (ClienteId);
SQL SELECT
FieldName1,

FieldName2,

etc


FROM Table;

Good luck!

Rainer

amit_shetty78
Creator II
Creator II

You may also try using the following sample using INNER JOIN. This will load only the data from both tables that have matching sKey value.


Table1:
LOAD sKey,
Tab_Field1
FROM [Sample Data.xls] (biff, embedded labels, table is Sheet1$);

INNER JOIN (Table1)
LOAD sKey,
Tab2_Field1,
Tab2_Field2,
Tab2_Field3,
Tab2_Field4;
ODBC CONNECT TO sqlDatasource;
SQL SELECT *
FROM sqlDatasource.dbo.Tab2;