Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where exists clause in script

Hi there,

Currently I have two scripts, one containing fact-tables and the second containing relevant dimensions of these facts. In my fact-script I have made a where clause that filters out observations that is not relevant. Therefore I would to perform a where exists load on my dimensions, in order to not just load every single dimension value. Currently I have tried the following syntax:

LIB CONNECT TO ...;

LOAD *;

SQL SELECT *

FROM EDW.qs.vDimCustomerSellTo where exists (vDimCustomerSellto);

I only want to load CustomerSellTo-values that are represented in my fact-tables.

All my fact-tables are loaded correct, however the statement above does not seem to work for me, does any of you know why?

Thank you in advance.

Nicolai

1 Solution

Accepted Solutions
Not applicable
Author

Hi Nicolai,

The where exists clause should be in the load statement

LOAD * where exists (vDimCustomerSellto);

SQL SELECT * FROM EDW.qs.vDimCustomerSellTo;

Should work.

Regards

Huub

View solution in original post

4 Replies
Not applicable
Author

Hi Nicolai,

The where exists clause should be in the load statement

LOAD * where exists (vDimCustomerSellto);

SQL SELECT * FROM EDW.qs.vDimCustomerSellTo;

Should work.

Regards

Huub

sasiparupudi1
Master III
Master III

exitsts is a qlikview function and it can only be used in for qlikview tables.. for sql you have to use your normal where conditions

hth

Sasi

Digvijay_Singh

You may try preceding load or resident load with Exists clause  to filter the record once loaded from source(without exists clause) or filter them at source only.

Not applicable
Author

Thanks Huub! That works perfect (Y)

Regards

Nicolai