5 Replies Latest reply: Jul 10, 2015 6:57 AM by reshma paturi RSS

    How to do left outer join in qlik via script

      Hi,

      i'm trying to do a left outer join from table a to table b.

      but i get always an error.

       

      My script:

       

      Load *;

      sql select cod_contenitore as contenitore_join

      from dir_documenti

      where dir_documenti.CLIENTE_1 = '04011' AND

                dir_documenti.COD_CLASSE_1 = 'QAV';

      left join Load *;

      sql select cod_contenitore as contenitore_join

      from dir_acquisizione

      where dir_acquisizione.CLIENTE_1 = '04011' AND

            dir_acquisizione.COD_CLASSE_1 = 'QAV'

            and join_reference is null;

        • Re: How to do left outer join in qlik via script
          Sunny Talwar

          Maybe the missing table names is causing an issue. Try this:

           

          Table:

          Load *;

          sql select cod_contenitore as contenitore_join

          from dir_documenti

          where dir_documenti.CLIENTE_1 = '04011' AND

                    dir_documenti.COD_CLASSE_1 = 'QAV';

           

          Left Join (Table)

          Load *;

          sql select cod_contenitore as contenitore_join

          from dir_acquisizione

          where dir_acquisizione.CLIENTE_1 = '04011' AND

                dir_acquisizione.COD_CLASSE_1 = 'QAV'

                and join_reference is null;

          • Re: How to do left outer join in qlik via script
            reshma paturi

            Hi,

            Try joining the sql tables directly like this

             

            Load *;

            sql select cod_contenitore as contenitore_join

            from dir_documenti left outer join dir_acquisizione on (dir_documenti .cod_contenitore=dir_acquisizione.cod_contenitore)

            where

            dir_documenti.CLIENTE_1 = '04011' AND

                      dir_documenti.COD_CLASSE_1 = 'QAV' AND

                      dir_acquisizione.CLIENTE_1 = '04011' AND

                      dir_acquisizione.COD_CLASSE_1 = 'QAV'

            ;