You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

UK Postcodes - return only the first part

Accepted answer
23
Views
10
Comments
edited Sep 4, 2019 8:32AM in Reporting & Analytics for B2C Service 10 comments

Summary

Trying to remove everything after a space in a report

Content

We have a field (let's say "incidents.c$postcode") containing UK postcodes. This is a text field.

For those unaware, the format of UK postcodes can vary, though the commonalities are:

  1. The postcode is in two parts, separated by a space
  2. The second part is always "Number,Letter,Letter"

The first part always begins with a letter, but it [the first part] could be:

  • Letter | Number
  • Letter | Number | Number
  • Letter | Letter | Number
  • Letter | Letter | Number | Number
  • Letter | Letter | Number | Letter (this format is rare)

 

Examples:

  • N1 1AA
  • L12 1AA

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!