3 Replies Latest reply: Feb 8, 2011 4:09 AM by Kuldeep Tak RSS

    how to use "in" keyword in qlikview

      what is the alternate of "in" keyword of sql in qlikview

      i use in sql

      select name from customer where cutomerid in (select customerid from customer where sal>5000)

      how i write this query in qlikview

      ?

       

        • how to use "in" keyword in qlikview
          Rakesh Mehta

          Look into EXISTS() function. It can be used in your WHERE condition.

          • AW:how to use "in" keyword in qlikview
            Martina Brenner

            Hi,

            best use the function exists()

            Tab1: Load ID1, * from Table1;

            Tab2: Load ID2,* from Table2 Where exists(ID1,ID2);

            With SQL Select ist looks like:

            Tab1: Load ID1, *; SQL Select * from Table1;

            Tab2: Load ID2,* Where exists(ID1,ID2); SQL Select * from Table2 ;

            • how to use "in" keyword in qlikview
              Kuldeep Tak

              Hi,

              You can use different approaches to achieve this.

              The first approach is :-

              Customers:

              Load *;

              SQL select * from customer where cutomerid in (select customerid from customer where sal>5000);

               

              The Second approach is :-

              CustomerCodes:

              Load customerid as Cust_Code ;

              SQL select customerid from customer where sal>5000;

               

              Customers_Temp:

              Load *;

              SQL select * from customer ;

              Customers:

              Load * ,

              1 as Test

              resident Customers_Temp where exists(Cust_Code, cutomerid )

              drop table Customers_Temp;

              drop table CustomerCodes;

              drop field Test;

               

              I hope this will help you.

               

              Thanks & Best Regards,

              Kuldeep Tak