Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

Where exist different connections

Hi,

Is it possible tu use where exist with different data sources.

For instance:

Specs:

A,

B,

from ..../...../......xls

Orders:

Product,

A,

Quantity

from {datasource} where exists A;

If not, any idea how limit Orders with where exists?

Thanks!

12 Replies
Not applicable

Orders:

Product,

A,

Quantity

from {datasource} where exists(A, A);

which means only load rows from 'datasource' where the value of 'A' has already been loaded into 'A' (which means into 'Specs')

Regards,

Gordon

Michiel_QV_Fan
Specialist
Specialist
Author

SQL error: Syntax error (comma) in query expression 'exists(DATE, DATE)'.
Script line: SELECT * FROM txBilling where exists(DATE, DATE)
SQL SELECT * FROM txBilling where exists(DATE, DATE)

This is error the error I get all the time.

This is the script line:

SQL SELECT * FROM txBilling where exists(DATE, DATE);

in which where and exists are not highlighted in blue

biester
Specialist
Specialist

I should say, the 'where exists(FIELD,EXPRESSION) ' in this form can only be used with LOAD, not with an SQL SELECT; the database you are querying does not know this form of where exists, hence the SQL syntax error

Rgds,
Joachim

Michiel_QV_Fan
Specialist
Specialist
Author

Joachim,

Do you have an example what statement to use with sql select?

biester
Specialist
Specialist

With SQL SELECT you can only use what the underlying database understands. The database of course does not know anything about tables in QlikView, so in the SQL SELECT itself there is no possibility to refer to them. You all have to do it with load. A possibility would be to store date into qvd and then load from qvd; THERE you can use where exists.

Rgds,
Joachim

Michiel_QV_Fan
Specialist
Specialist
Author

Thanks that a clear explanation for me.

The search continues for me.

biester
Specialist
Specialist

What search? If I get you right I think what you want to achieve is possible without any problems.

e. g.:

Specs:

Load A,B from ..xls;

Orders_Temp:
SQL Select Product,A as A_Temp,Quantity from {Database};

Orders:
LOAD * resident Orders_Temp where exists(A,A_Temp);

drop table Orders_Temp;

Just a rough sketch without trying it, but it should work with more or less modifications in your case.

Rgds,
Joachim

Michiel_QV_Fan
Specialist
Specialist
Author

Search -> still learning qlikview. To be the first Certified Qlikview Consultant in the company for which I work Smile

biester
Specialist
Specialist

Ah, ok, I understand!

Wish you all the best!