Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Load where Exists (iseries(

Hi all,

This works well

  

H_Order:

LOAD *, (OTAAOR & OTNUOR) AS KeyOrd;
SELECT *
FROM   HORDER;
L_Order:
LOAD *,
(ORAAOR & ORNUOR) AS KeyOrd         
WHERE EXISTS (OTNUOR, ORNUOR) ;
SQL SELECT *
FROM   LORDER;

This one causes an error on EXIST istruction

 

H_Order:
LOAD *, (OTAAOR & OTNUOR) AS KeyOrd;
SELECT *
FROM   HORDER;

L_Order:
LOAD *,
(ORAAOR & ORNUOR) AS KeyOrd;
SQL SELECT *
FROM   LORDER
WHERE EXISTS (OTNUOR, ORNUOR);

I have to use exist only after LOAD STATEMENTS ?

Many thanks in advance

4 Replies

Re: Load where Exists (iseries(

Yes, because Where Exists is a QlikView function, AFAIK. You cannot take that into your SQL. I am sure there must be a way to check Where Exist in SQL, but that will have to be done by using the SQL queries.

MVP
MVP

Re: Load where Exists (iseries(

Everything after SQL up to the semicolon will be sent to the SQL driver and executed by the driver.

SQL SELECT *

FROM   LORDER;


If you want to use the QV function EXISTS(), you need to use it in a preceding QV LOAD statement.

MVP
MVP

Re: Load where Exists (iseries(

Sunny, there exists also a SQL Exists() condition, but the syntax is different. I assume the OP is refering to the QV functions Exists().

Re: Load where Exists (iseries(

Right, that's what I meant. There is definitely a way to do it but the syntax would require to have the two tables in one SQL and doing some manipulation. The back and forth interaction with SQL won't work the way tried above is what I was trying to refer.