Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I've browsed the forums but couldn't find my answer.
I have a set of data (set a) with Post Codes, and another set of data (set b) with all UK Post Codes.
I want to quality check that the Post Codes in set a appear in set b, and ideally produce a field called 'PostCodeValid' with the options of either 'Y' or 'N'.
Many Thanks
MAP:
MAPPING LOAD
Postcode, 'Y' as F2
FROM AllUKPostcodeTable;
TABLE:
LOAD
Postcode,
applymap('MAP',Postcode, 'N') as Valid,
..
FROM YourTable;
MAP:
MAPPING LOAD
Postcode, 'Y' as F2
FROM AllUKPostcodeTable;
TABLE:
LOAD
Postcode,
applymap('MAP',Postcode, 'N') as Valid,
..
FROM YourTable;
If the table with all Post codes is "Tab1" and the other table is Tab2 then, supposing that the post code in both tables is "myPostCode" then
MyTable: noconvìcatenate
Load * resident Tab1;
left join
Load distinct *, 'Y' as flag resident Tab2;
Now, where you find 'Y' it means that a code from tab2 matches with an identical code in tab1 otherways you have unmatching codes
Hope it helps
Thank you and thanks Alexandros17 your method works too.