In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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
20 - Arcturus

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
20 - Arcturus

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

binu_acs
21 - Polaris

@jatienza Another way of doing this 

binuacs_0-1677224631890.png

 

jatienza
8 - Asteroid

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

Labels
Top Solution Authors