Free Trial

Alteryx Designer Desktop Discussions

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

Parsing Address

jatienza
8 - Asteroid

Hi!,

 

Need help in parsing the address into address 1, city, state, postcode, country. Below is the raw data and output.

 

Raw Data:

Address
Au. Ricchieri Km 17; Tapiales, Buenos Aires 1771, AR
Weerhuisweg 4; Maastricht, Limburg 6226, NL
Route de la Fènerie; Pégomas, Alpes-Maritimes 06580, FR
Lyndon B Johnson Fwy; Dallas, Texas 75237, US

Los Angeles , CA, US

 

Output:

address 1city statepostcodecountry
Au. Ricchieri Km 17TapialesBuenos Aires1771AR
Weerhuisweg 4MaastrichtLimburg06226NL
Route de la FèneriePégomasAlpes-Maritimes06580FR
Lyndon B Johnson FwyDallasTX75237US
 Los AngelesCA US
6 REPLIES 6
BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@jatienza Here's one way:

BS_THE_ANALYST_1-1676651568922.png

 

RegEx: 

BS_THE_ANALYST_2-1676651591019.png

 

 

All the best,
BS

LinkedIN

Bulien
BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@jatienza  Actually this solution is better. It only uses one tool. I made use of an optional non-capturing group:

BS_THE_ANALYST_0-1676651944240.png

 

 

 

All the best,
BS

LinkedIN

Bulien
jatienza
8 - Asteroid

Hi @BS_THE_ANALYST , it works but does not work if some address are unstructured.

BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@jatienza can you provide me with some examples of where it's not working? Also the expected output too, it'll be quicker for me to build the logic

 

All the best,
BS

LinkedIN

Bulien
jatienza
8 - Asteroid

@BS_THE_ANALYST below is a sample data. I added address 2 field. Should also apply on the first raw data I posted.

 

Address
ATM conNorte; Mza. Tt. 9; Playa del Carmen, Quintana Roo 77710, MX
Actor Dr; Woodstock, Ontario N4V 1B9, CA
105 Monnet; Elancourt, FR
Valencia, ES
4th St; Davenport, Iowa 52801-1902, US

 

Output:

address 1adress 2city statepostcodecountry
ATM conNorteMza. Tt. 9Playa del CarmenQuintana Roo77710MX
Actor Dr WoodstockOntarioN4V 1B9CA
105 Monnet  Elancourt FR
  Valencia  ES
4th St DavenportIA52801-1902US
BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@jatienza this is where things become really difficult. Look at that particular pattern:
BS_THE_ANALYST_0-1676656216941.png

They both match exactly the same but you want them in different columns. Also, some addresses now appear to have Address 1, Address 2? There could be Address 3, Address .. N.

When this amount of variety comes in, it's hard to establish a catch all RegEx expression. 

I saw a recent post here trying to accomplish similar things: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Parsing-Out-City-Name/m-p/1083755/high... . Potentially you could use a lookup table to parse parts out using this concept. 

 

 

 

All the best,
BS

LinkedIN

Bulien
Labels
Top Solution Authors