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

if exists

I would like to use the sql command exists on a resdint table

It look like this

Select Field1,

Field2

from oracle.Table

where exists (load field1 resident qv.table)

can any one help me

3 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

exists is not a SQL command, it's a QlikView one. In SQL, you can use "IN" as an alternative, if you are comparing to a SQL table... If you need to compare to QlikView table, you need to add a preceding load and use QlikView functions like exist() there. Your SQL statement will still return a full table, and the end results will be filtered out by the preceding load.

If it's important to filter our the SQL table itself, and if the number of available values in Field1 is not too high, you can try creating a list of possible values using function concat(), and then using $() - expansion to bring the list of values into SQL.

Something like this:

1. Calculate the list of values and store it in a variable vList

2. SQL SELECT ... FROM ... WHERE Field1 IN ( $(vList) )

good luck!

Not applicable
Author

appricaite your help

but my in table will be to long is there an other solution

thankx

johnw
Champion III
Champion III

LOAD *
WHERE EXISTS(Field1)
;
SQL SELECT
Field1
,Field2
FROM Oracle.Table
;