Start Free Trial

Alteryx Designer Desktop Discussions

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

Parse address fields

aparna0208
9 - Comet

Hi,

 

Need help with parsing address fields. I have a situation where the addresses are in two columns(Address 1 and Address 2). Some rows contain the branch names in the address fields(please see below). Wanted to see if there is a way to use regular expressions to see if address line 1 contains a number. If not, then check line 2. If address line 2 starts with a number and line one doesn't contain one, then replace line 1 with line 2. Thanks in advance!

 

AddressAddress Line 2
ABC WEALTH ADVICE CENTER INC500 HARBOR BOULEVARD
250 MUNOZ RIVERA AVENUE, PH FL 
2 REPLIES 2
T_Willins
14 - Magnetar
14 - Magnetar

Use a formula tool with Output Column set to Address and the following formula:  IF REGEX_Match([Address], ".*\d.*") = -1 THEN [Address] ELSEIF REGEX_Match([Address Line 2], ".*\d.*") = -1 THEN [Address Line 2] ELSE [Address] ENDIF

 

This will see if the Address field has a number in it, if yes, keep what is in Address otherwise look at Address Line 2 to see if it has a number in it, if yes, replace Address with Address Line 2.  If neither have a number, then keep as is.

aparna0208
9 - Comet

Thanks much for the quick response! Awesome, it just worked the way I wanted. Thank you so much for your inputs on this:) @T_Willins 

Labels
Top Solution Authors