I'm loading a spreadsheet for postcode prefixes and their region (ie "MK" = "Midlands") and joining on the first part of the full postcode...
However there are some postcode prefixes in my data which do not have a match in the spreadsheet.
I'd like to set those records' prefixes to have a value of 'other' on load something like:
PostCode, if (isnum(mid(PostCode,2,1)), left(PostCode,1),Left(PostCode,2)) as PostCode_Part1, if(exists( [ PostCode_Part1 in the Excel file ] ),'PostCode_Part1','Other') as PostCode_Part1b,
This is the xls load statement:
LOAD Prefix as PostCode_Part1, Region FROM MyXLS.xls
This 'Other' value in PostCode_Part1b will then match with the 'Other' row in the spreadsheet which will return 'Other' as a region...