Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Compare tables against each other

Could use a bit of understanding, I'm loading three tables with data sharing one key field. Table 1 has all the possible key members, table 2 and table 3 have partial member sets. When displayed all three tables show rows for all members in Table 1 which I assume is being driven by the key field as the RowCount of tables 2,3 are less then table one.

Problem:

I want to add a row to table 3 for every member of table 1 that is missing from table 3. I am currently brute forcing the effort by searching all key members from table 1 against a non key field in table 3 that contains the key value in a longer string with a SubStringCount search using nested "For" loops. If i don't find a match I inline a record to table 3.   Looking for a more eloquent solution , I feel like I'm taking a big sledge hammer to a wine glass...

Thanks,

Dave

4 Replies
Anonymous
Not applicable
Author

Hi Dave.

Have a look at the exists function and/or joining tables

Exists ‒ QlikView

Join ‒ QlikView

Regards,

Bas.

jonathandienst
Partner - Champion III
Partner - Champion III

>>I want to add a row to table 3 for every member of table 1 that is missing from table 3.

What do you want in that row? If you are just adding the key and leaving everything else null, then why?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thanks for the replies, sorry for the delay (day job got in the way).  In table 3 I want to add a value to an table 3  field for a key member that had no data when the table 3 data was read, similar to updating a database row, but the row doesn't yet exist (or does it exist logically because of the key??).  Well the rookie is showing, i will go back and review exists and join to see if i can leverage them....

Thanks !

Anonymous
Not applicable
Author

Looks like an outer join will do the trick and then a load resident so i can modify the value in a single field if its null.  Data set is small so should not be an issue, now for presentation !

Thanks for responding, I appreciate it.

Dave