3 Replies Latest reply: May 11, 2010 7:21 PM by John Witherspoon RSS

    if exists

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

      It look like this

      Select Field1,


      from oracle.Table

      where exists (load field1 resident qv.table)

      can any one help me

        • if exists
          Oleg Troyansky

          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!