Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested Select SQL Where Clause

Wondering if I can do a nested select SQL statement in QLikview script... Qlikview seems grouchy though, however, I'm certain my syntax is not correct...

I have a QlikView file:TEMPFILE with only one "SchoolCode" field that contains distinct SchoolCode values.

So,

I want to LOAD new data from a database... using only data with SchoolCodes that are in the tempfile...

LOAD * From DBO.TABLENAME

WHERE SchoolCodes IN (select distinct SchoolCode from TEMPFILE)

;

What am I doing wrong?

Stephanie

7 Replies
Specialist II
Specialist II

Hello Stephanie,

You can do :


TempFile:
LOAD SchoolCode FROM TempFile.xls;
Table:
LOAD * FROM DBO.TABLENAME WHERE EXISTS (SchoolCode);


Hope it's gonna be helpful.

Martin

Specialist II
Specialist II

Hello Stephanie,

You can do :


TempFile:
LOAD SchoolCode FROM TempFile.xls;
Table:
LOAD * FROM DBO.TABLENAME WHERE EXISTS (SchoolCode);


Hope it's gonna be helpful.

Martin

Not applicable

Load your temp file in memory:


LOAD * FROM TEMPFILE.qvd (qvd);


After execute the SQL Statement:


LOAD * WHERE exists(SchoolCode);
SQL SELECT * FROM DBO.TABLENAME;


Not applicable

USE THE SQL COMMAND IN PLACE OF LOAD


SQL SELECT *
FROM DBO.TABLENAME
WHERE SCHOOLCODES IN (SELECT DISTINCT SCHOOLCODE FROM TEMPFILE)


REGARDS
TONIAL.

Not applicable

You folks are awesome. Thanks a bunch... I understand SQL... but mixing QlikView Scripting experience with it is where I am lacking.

Thanks again for the responses, I tried each of the methods as well.

Stephanie Lind

Not applicable

HI

I like to find out how to do a IN criteria when using a qvd load or a resident load.

Thanks

Contributor III
Contributor III

Hi Jack,

With QVD load You need use the match-function.

load * from ???.qvd where match(fieldname,value1,value2,...);