UK Postcode check
Hi,
I have a requirement where I receive a csv file with postcode(no other address fields is provided), and I need to do the below
1. Mention if the postcode is Valid and compliant as per Address GBR data
2. Standardize raw postcode value to UK postcode format
3. Specify the reason for UK postcode being invalid/non-compliant
I used the Is UK Postcode format function and it gave me result for Step1. However, when the passed rows are passed through Validate Address step to get details for Step2, I am getting majority rows as Partial match/Unmatched. So, in short, the result of Passed rows from Is UK Postcode format function is not matching when looked up in Validate Address step.
Can someone suggest which one to be considered while validating the UK postcode??
Also, for Step3 can someone suggest on how to get the details of Is UK Postcode format function failure?
Setup
Aperture Data Studio (2.14.14.40)
Address GBR data (Dec 2024)
Answers
-
Some things to note:
Validating a postcode format
The Is UK Postcode format function is a format validation, using a regular expression to assess whether an input value "looks like" a UK postcode, rather than testing whether it is in fact a postcode that is currently in use. The validation is reasonably smart, taking into account valid characters and combinations of characters in the Ares, Sector, District and Unit positions, but it is ultimately a format check.
So for example "DE6 1YX" will validate successfully, even though the postcode does not exist (as confirmed in Royal Mail's postcode finder). Another example, "BR1 1LP", is a postcode that validates and indeed was a valid postcode until it was terminated in 2019. There's a surprisingly high churn rate of UK postcodes so any validation of values would need to necessarily use up-to-date reference data.
Validating a full address
The Validate Addresses step in Data Studio uses up-to-date reference data from sources such as the Royal Mail to validate full addresses. You pass in as much information as you have for an address and the step attempts to match to the intended premise, returning it along with match information and a confidence indicator.
As such, passing just a postcode into the Validate Addresses step will rarely be enough to identify an address and you will see "Unmatched results".
Validating that a postcode currently exists
The method I typically use to check if a postcode is currently in use in the UK is to Lookup against a recent reference set of postcodes. Simple datasets are available freely (look at organisations like ONS and Ordnance Survey), but if you want something more flexible in terms of format, method and frequency of supply, or additional enrichment data, contact Experian Data Quality or your EDQ account manager.
1