Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Not applicable

using where exists() on sql load

Hi,

i have a small problem with "where exists" and a sql load and did not find existing solutions while searching the community. Where existst works fine with qvd containers or resident loads, but seems not to work with external sql sources.

my goal is to limit a load from a qvd container and then limit the load form a sql database by a field from the previous qvd load.

customers:

LOAD

CU_ID,

firstname,

lastname,

company,

areacode,

createdate

FROM

$(vQVDstore)customers.qvd

(qvd)

where createdate>=20100101

;

ORDERS:

SQL SELECT * FROM DB."customer_orders"

where exists (CU_ID)

;

All i gt is an error. where exist works with other loads and SQL supports where exists like in this example:

SELECT *

FROM suppliers

WHERE EXISTS (SELECT *

              FROM orders

              WHERE suppliers.supplier_id = orders.supplier_id);

I will appreciate any help or suggestions, thank you

3 Replies
MVP
MVP

Re: using where exists() on sql load

where exists (select * from ......) is a valid sql syntax (subquery)

where exists (CU_ID) isn't a valid sql syntax

you are making a mix between sql syntax and qlikview syntax trying to ask to the database server to check  for a valid CU_ID (field of a QlikView in memory db)

I think it could be

ORDERS:

load * where where exists (CU_ID);

SQL SELECT * FROM DB."customer_orders";

the SQL ....... read all the table from the dbms

the load filter CU_ID in QlikView

msjohnson
New Contributor

Re: using where exists() on sql load

Does anyone have a solution for an incremental load situation, where we would like to avoid loading the entire table and then filtering?   Specifically, after a load of a qvd that contains order numbers, only select those rows from the database using the order numbers from the qvd.  In this situation there is no other way to identify the records in the database.

Thanks for any ideas.

MVP
MVP

Re: using where exists() on sql load

usually there is a timestamp, date, a field (createdate?) to identify changed record from last qlikview reload

in QlikView help there is a "using qvd file for incremental load" with 4 different examples