2 Replies Latest reply: May 6, 2014 2:06 PM by Henric Cronström RSS

    Select and Join On in Qlikview

      Hi, I have the following SQL select join in Qlikview and I'm struggling to get it to work. Works fine elsewhere.


      Is there some obvious im missing or a better way to do it?



      SQL##f - SqlState: S0002, ErrorCode: 208, ErrorMsg: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'REPTABLE_MDM'.


      SQL select uname,

      'Displaced' as Tracking_Status

      from REPTABLE_MDM A

      join (select distinct uitemno from REPTABLE_MDM

      where yearmonthvalue between 201312 and 201404 and category='Permission ID'

      and uitemno is not null) as C ON A.uitemno=C.uitemno

      where A.yearmonthvalue=201404 and not exists(select distinct uitemno from REPTABLE_MDM B

      where yearmonthvalue=201404 and category='Permission ID'

      and uitemno is not null

      and A.uitemno=B.uitemno);

        • Re: Select and Join On in Qlikview

          Have you tried to make the join separately:

          1- Table_1::

               LOAD *, 'Displaced' as Trackin_Status;

               SQL select uname;


          Store Table _1;

          drop table_1;


          2.: Table_2:

               LOAD *;

              SQL select distinct uitemno from rep ............... and A. uitemno = B.uitemno);


          Store Table_2;

          drop Table_2

          3.- finally


               load * from Table_1;



               load * from Table_2;


          I hope this would be useful



          • Re: Select and Join On in Qlikview
            Henric Cronström

            Since you have the error message "Invalid object name 'REPTABLE_MDM' ", I assume that this table does not exist in the default library of the ODBC. So, you have the wrong library in your ODBC connection.


            If you add the library to your SELECT statement, i.e.

                 SQL SELECT ... FROM <Library>.REPTABLE_MDM

            it should probably work.