Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
rdsuperlike
New Contributor III

where exists syntax with sql

I want to do


Table1:

Load

a_key,

b,

c;

SQL

select * from

......;

where not exists (a_key)

from tab2.qvd;





Or



Load

a_key,

b,

c;

SQL

select * from

......;


MINUS


Tab2.qvd



but looks like syntax is wrong.

Can someone help me here?



Tags (2)
4 Replies
qlikviewnovice
Valued Contributor II

Re: where exists syntax with sql

Hi,

Is this complete script?

Re: where exists syntax with sql

Table1:

Load

a_key,

b,

c;

SQL

select * from

......;

where not exists (a_key)

from tab2.qvd;

Are you trying to load data from SQL where a_key is null? Is that the intention here???

Re: where exists syntax with sql

You couldn't apply a exists() to a sql-statement because it's a qv function. Commonly used in such cases is Preceding Load. Another possibilities are to load the sql-table complete and apply then a second load with an exists() filter - see also: The exists issue - or using a join/keep to filter your table.

If your sql-load is quite large it could be useful to convert the exists-logic in a sql-function like SQL: IN Condition.

- Marcus

Not applicable

Re: where exists syntax with sql

You should load Table2.qvd and after that the LOAD with exists previous to the SQL:

Table2:

LOAD

    a_key,

    *

FROM Table2.qvd(qvd);


SQL_Table:

LOAD

    a_key, b, c

where exists(a_key, a_key);

SQL SELECT * FROM Table;

Community Browser