3 Replies Latest reply: Jul 15, 2015 5:22 AM by David Gilligan RSS

    Problem with my Join Statement

      Hello, I have two tables in QlikView, a Header table and an items table.  There is a one (header) to many (items) relationship between the two.  They are loaded as sunch (one after another):  The 3 Uniques are unique only when combined into DocKey

       

       

      Load
         
      Unique1 & Unique2 & Unique3 as %DocKey,
         
      Unique1,

          Unique2,

          Unique3,

          HeaderNumber

          HeaderInfo1
         
      FROM [C:\QlikView\Header.qvd](qvd)

      LOAD
         Unique1 & Unique2 & Unique3 as %DocKey,
         
      Unique1,

          Unique2,

          Unique3,

          ItemNumber

          ItemPrice
      FROM [C:\QlikView\Item.qvd](qvd)

       

      The problem is that evey load combination I have tried fails, I either can use ItemNumber and ItemPrice OR HeaderNumber and HeaderInfo but I cannot use all, but the joins all work but the tables remain the same.

       

      Any ideas?

      Thanks in advance!

        • Re: Problem with my Join Statement
          Alessandro Saccone

          If you do:

           

          Load
             
          Unique1 & Unique2 & Unique3 as %DocKey,
             
          Unique1,

              Unique2,

              Unique3,

              HeaderNumber

              HeaderInfo1
             
          FROM [C:\QlikView\Header.qvd](qvd)

           

          join

           

           

           

          LOAD
             Unique1 & Unique2 & Unique3 as %DocKey,
             
          Unique1,

              Unique2,

              Unique3,

              ItemNumber

              ItemPrice
          FROM [C:\QlikView\Item.qvd](qvd)

           

          the result will alwayzs be only 1 table containinng all the combinations from the two. If you mean instead of join a association then you have to do:

           

          HEAD:

          Load
             
          Unique1 & Unique2 & Unique3 as %DocKey,
             
          Unique1,

              Unique2,

              Unique3,

              HeaderNumber

              HeaderInfo1
             
          FROM [C:\QlikView\Header.qvd](qvd);

           

          ITEM: noconcatenate

          LOAD
             Unique1 & Unique2 & Unique3 as %DocKey,
             
          Unique1,

              Unique2,

              Unique3,

              ItemNumber

              ItemPrice
          FROM [C:\QlikView\Item.qvd](qvd)

           

            • Re: Problem with my Join Statement

              Thanks!  You should seee how complex I tried to make it.  This will give a proper one to many join???...I am testing now mut locally and there is a lot of data....It looks loke does, I will take a look at the refresh just finished.  I juess creating the %DocKey is not necessary as it will connect on the Unique keys automatically?

            • Re: Problem with my Join Statement
              Manish Kachhia

              Load
                 
              Unique1,

                  Unique2,

                  Unique3,

                  HeaderNumber

                  HeaderInfo1
                 
              FROM [C:\QlikView\Header.qvd](qvd)

              Join

              LOAD
                 
              Unique1,

                  Unique2,

                  Unique3,

                  ItemNumber

                  ItemPrice
              FROM [C:\QlikView\Item.qvd](qvd)