Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I've got two files that I'm loading into QV. File A has a unique key (no duplicates), the other, File B, has duplicate records for each key. File A may have a match to one or many records on File B, or there may be no match. I want to add a field to File A to say whether there is a matching record/s in File B. I'm not interested in how many records are on B for a particular key, just whether there are any matching records or not.
Can anyone help?
Thanks!
Hi,
Try this solution:
MapFile:
Mapping Load Key, 'Matched' as Flag
Resident B;
AA:
Load Key, ApplyMap('MapFile',Key) as MatchFlag
Resident A;
Hope this would help you(your new field in A is matchflag).
Regards, tresesco
Hi,
Try this solution:
MapFile:
Mapping Load Key, 'Matched' as Flag
Resident B;
AA:
Load Key, ApplyMap('MapFile',Key) as MatchFlag
Resident A;
Hope this would help you(your new field in A is matchflag).
Regards, tresesco
Hello, James.
If I understand you, you can to use RIGHT KEEP statement for loading data, like as:
Table_A:
LOAD KeyField, .... FROM....
Table_B:
RIGHT KEEP(Table_A)
LOAD KeyField, .... FROM....
after loading this script you will get two tables:
Table_B - all lines table B (as in source data)
Table_A - only lines, which are exists in Table_B (by KeyField)