1 Reply Latest reply: Jul 29, 2016 4:32 PM by Stefan Wühl RSS

    Duplicate data in table created in script

    Eddie Cantave

      Hello,

       

      I'm having several issues with this script.

       

      The first is that when I load this script, the IDs that get the Account No. added from the Peek(), get duplicated in the resulting data.

       

      DomainAccountIDAccount No.
      Company ASales61561521
      Company ASales62591521
      Company ASales6259-
      Company ASales64591521
      Company ASales6459-

       

      I need to remove the data for ID that doesn't have the Account No. associated.

       

      The second is that the Table NHDBID doesn't show up as its own table in Qlik Sense.  I don't know if that's adding to the problem, but I thought that the script would have created a Table called NHDBID, and maybe using Drop Table NHDB would fix the issue above.

       

      The script I'm referring to is below:

       

      NHDB:

      Load

      [ID],

      Domain,

      Account

      resident ID;

       

       

      Left Join

      Load

      [ID],

      [Account No.]

      Resident Sales;

       

       

      NHDBID:

      Load

      Domain,

      [ID],

      If(IsNull([Account No.]),Peek([Account No.]),[Account No.]) as [Account No.],

      Account

      Resident NHDB

      Order By Domain, [ID];

        • Re: Duplicate data in table created in script
          Stefan Wühl

          Your tables NHDB and NHDBID gets auto-concatenated, due to the same field names in both tables.

           

          Use NOCONCATENATE LOAD prefix to prevent QS from doing this, then drop table NHDB:

           

           

          NHDB:

          Load

          [ID],

          Domain,

          Account

          resident ID;

           

           

          Left Join

          Load

          [ID],

          [Account No.]

          Resident Sales;

           

           

          NHDBID:

          NOCONCATENATE Load

          Domain,

          [ID],

          If(IsNull([Account No.]),Peek([Account No.]),[Account No.]) as [Account No.],

          Account

          Resident NHDB

          Order By Domain, [ID];

           

          DROP TABLE NHDB: