Alteryx Designer Desktop Discussions

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

Need help in parsing address

jatienza
8 - Asteroid

Hi,

 

Need help in parsing the below raw data. Also, output is shown below.

 

Raw Data

Address
Baden-Württemberg 86797
Vendée 87000
Нижнесилезское воеводство  51-501
Hauts-de-France 86740
Île-de-France 75188
Distrito Federal 72905-450
Woj. Mazowieckie 02-952
São Paulo

Bogotá D.C 137211

 

 

Output

add1add2
Baden-Württemberg86797
Vendée87000
Нижнесилезское воеводство51-501
Hauts-de-France86740
Île-de-France75188
Distrito Federal72905-450
Woj. Mazowieckie02-952
São Paulo 
Bogotá D.C137211
5 REPLIES 5
apathetichell
18 - Pollux

Sao Paulo was being annoying - let me fix that.

 

add1:

regex_replace([Address],"^(.*)\s(\d+-*\d*)$","$1",1)

 

ugly add2:

regex_replace(replace([Address],[add1],""),"^\s*(\d+-*\d*)$","$1",0)

martinding
13 - Pulsar

Hi @jatienza 

 

You could try this:

martinding_0-1677185736617.png

 

apathetichell
18 - Pollux

@martinding 's is superior - run with that answer unless you have a paranoid aversion to the regex tool.

binuacs
20 - Arcturus

@jatienza Another way of doing this 

binuacs_0-1677224631890.png

 

jatienza
8 - Asteroid

Thank you for you help! @binuacs @apathetichell @martinding 

Labels