2 Replies Latest reply: Mar 6, 2017 9:19 AM by Stefan Wühl RSS

    How to join two tables?

    Arghya Ray

      Hi Everyone,

      I have two tables: TABLE1 has columns DOI,JID,FUNDING

      another table as : TABLE2 has columns like DOI,WALS

      How can I join the two tables?

      My code is like:

       

      JOIN_TABLE:

       

      Load DOI,JID,FUNDING

      Resident TABLE1;

      inner join

      Load DOI,WALS

      Resident TABLE2;

       

      When I do

       

      FINAL_TABLE:

       

      Load DOI,JID,FUNDING,WALS

      RESIDENT JOIN_TABLE;

       

      The error it shows is that can't find table FINAL_TABLE.

       

      There is a problem with the join I think. Qlikview intelligently doesnot identify DOI as the joining field. Can anyone help me out?

        • Re: How to join two tables?
          Staffan Johansson

          Hi,

           

          keep it simple! first try to just Connect the tables With an qlikview Association, like this:

           

          New_Table1:

          Load DOI,JID,FUNDING

          Resident TABLE1;

           

          New_Table2:

          Load DOI,WALS

          Resident TABLE2;

           

          Maybe you should drop tables here, I dont know, the Whole scripts isent here.

           

          You can also use applymap from TABLE2 to get WALS into TABLE1.

           

          MapTable:

          Mapping Load

          DOI,

          WALS

          Resident TABLE2;

           

          Load DOI,JID,FUNDING, applymap('Maptable',DOI,'No match') as WALS

          Resident TABLE1;

           

          • Re: How to join two tables?
            Stefan Wühl

            I guess QlikView has auto-concatenated your tables you loaded for JOIN with the previously loaded resident tables.

             

            Force Qlik to not concatenate the tables:

             

            JOIN_TABLE:

            NOCONCATENATE

            Load DOI,JID,FUNDING

            Resident TABLE1;

             

            inner join (JOIN_TABLE)

            Load DOI,WALS

            Resident TABLE2;

             

             

            FINAL_TABLE:

            NOCONCATENATE

            Load DOI,JID,FUNDING,WALS

            RESIDENT JOIN_TABLE;

             

            DROP TABLE JOIN_TABLE;

            // to avoid a syn key table and two identical tables, basically final table should be same as JOIN_TABLE, right?