3 Replies Latest reply: Aug 26, 2015 9:16 AM by Jonathan Dienst RSS

    Can anybody explain how this Where Not Exists function eliminates old value with new value in my data?

    John Blomqvist

      Hi all

       

      I have the following data in two tables:

       

      Transactions:

      Transactions.JPG

       

      NewTransactions:

      NewTransactions.JPG

       

       

      Transaction ID S0451 in the NewTransactions table above has a new value. I would like to use this new value instead of the value in the Transactions table.

       

      This is my script:

       

      //**Load incremental data**

      Transactions:

      LOAD Region,

           TransactionID,

           Product,

           Sales,

           ModifiedDate

      FROM

      [Transcations Insert.xlsx]

      (ooxml, embedded labels, table is NewTransactions)

      Where ModifiedDate > $(vLastModifiedDate);

       

       

      //**Original transactions data**

      Concatenate(Transactions)

      LOAD Region,

           TransactionID,

           Product,

           Sales,

           ModifiedDate

      FROM

      Transactions.qvd

      (qvd)

      Where not Exists(TransactionID);

       

      I get the following output:

       

      Capture.JPG

       

      What I don't understand is how Where not Exists(TransactionID) expression works.

       

      Why does it take the new value and deletes the old one? Is it because I have it in the second table and not the first?