Skip to main content
Added tested version of QGIS
Source Link

Try this:

left("Postcode", length("Postcode")-3) + ' ' + right("Postcode", 3)

It takes all characters of Postcode except the last three ones, adds a space and then appends the last three characters.

Edit.: I tested this in QGIS 2.18.22

Try this:

left("Postcode", length("Postcode")-3) + ' ' + right("Postcode", 3)

It takes all characters of Postcode except the last three ones, adds a space and then appends the last three characters.

Try this:

left("Postcode", length("Postcode")-3) + ' ' + right("Postcode", 3)

It takes all characters of Postcode except the last three ones, adds a space and then appends the last three characters.

Edit.: I tested this in QGIS 2.18.22

Source Link

Try this:

left("Postcode", length("Postcode")-3) + ' ' + right("Postcode", 3)

It takes all characters of Postcode except the last three ones, adds a space and then appends the last three characters.