5 Replies Latest reply: Jul 11, 2013 6:03 AM by George Duckett RSS

    Check if a field value exists within a specific table?

    George Duckett

      I'm doing incremental loads and as part of that I have the usual concatenate from my qvd where Not Exists(MyField).

       

      This works fine when the field only exists in one table, but I think it's failing when I have the field in multiple tables.

       

      I have a facts table that among other things has a CallKey field which is unique to a call. This table has joined data so the CallKey will appear in multiple rows.

       

      For this reason I also have a table CallCount which has fields CallKey and Count which has one row per CallKey and a 1 in the Count field.

       

      My problem is that I'm saving both of these tables to QVDs then trying to load new/updated values afterwards.

       

       

      I first load old data for Facts, which includes my CallKey values, then I load old data for CallCount, but because I only want to load records not already loaded I do a where Not Exists(CallKey).

       

      The trouble is, the CallKey does already exist, but in another table.

       

      How can I still load the record in my CallCount table, where the Key field already exists in another table?