Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Add white space

olehr
8 - Asteroid

Hi, 

 

I have a filed in my dataset which is a bit unrorganized.  The data contains an adress field with the format:  Vollsveien100A. 

However, I want to ad a white space between the street name and the housnumber such that the format is:  Vollsveien 100A.  

 

Any suggestions?  

 

Kind regards. 

7 REPLIES 7
LJoonas
7 - Meteor

Hi,

 

REGEX_Replace should do the trick. I'm not that familiar with Regex, but if all the addresses are in the same format as the example, I think the formula: REGEX_Replace([Field1], "(\d+)", " " + "$1") should work. It adds white space before every string of characters that have one or more numbers at the beginning. If the address can be in different format, you might have to modify the regex formula.

afv2688
16 - Nebula
16 - Nebula

Hi @olehr ,

 

use the regex tool with the following command:

 

(^[[:alpha:]]*)( [[:alpha:]]*)?(\d+)

 

Untitled.png

 

Cheers

 

 

olehr
8 - Asteroid

Thanks for the suggestion. That helped :)

LJoonas
7 - Meteor

Thanks. You should also check @afv2688 answer. I think it is more reliable in case the format can differ. 

olehr
8 - Asteroid

Hi @afv2688

 

I am rather unfamiliar with regex, so not quite sure what is going on in the expression that you use. Could you explain ? :)

 

Best regards

 

Ole

afv2688
16 - Nebula
16 - Nebula

What the regex tool is doing is something like this:

 

(^[[:alpha:]]*)( [[:alpha:]]*)?(\d+)

 

(^[[:alpha:]]*): If the field starts with a word

( [[:alpha:]]*)?: and there is (or maybe not, thats why the question mark is there) another word

(\d+): and in the end is a number

then separate it by

firstword + possible second word + street number

 

cheers

 

olehr
8 - Asteroid

Thank you so much :)

Labels