Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Text string extraction

tww
8 - Asteroid

Hi all,

 

I think this might be a simple question, however I am new to Alteryx so hopefully someone could help me. I tried to use text to columns but not sure what to do with "174 Apple Valley Mn" and "768324 Prior Lake Mn". Thanks

 

Input

087 Greenwood In
079 Chanhassen Mn
116 Chanhassen Mn
163 Chanhassen Mn
076 Monticello Mn
076 Monticello Mn
157 Buffalo Mn
171 Buffalo Mn
174 Apple Valley Mn
768324 Prior Lake Mn

 

Ouput

 

87GreenwoodIn
79ChanhassenMn
116ChanhassenMn
163ChanhassenMn
76MonticelloMn
76MonticelloMn
157BuffaloMn
171BuffaloMn
174Apple ValleyMn
768324Prior LakeMn
8 REPLIES 8
Amilley
8 - Asteroid

There are probably a few ways that you can tackle this, but based on your comment about being new, let's stick w/ text to columns and do some simple concats Vs some more complex regex (but that is another feasible option).

 

Use the TtC tool, split into 4 columns instead of 3, and then simply use a logical concat for those with the extra space.

 

Thats the high-level framework - give me a sec, and Ill post a visual

martinding
13 - Pulsar

Hi @tww 

 

You can use the Regex Tool to parse the field

 

martinding_0-1680300096637.png

 

 

Amilley
8 - Asteroid

@tww Here is the simple step through including the example workflow

 

Amilley_0-1680300136283.png

Amilley_1-1680300142813.png

 

 

 

Amilley_2-1680300164185.png

 

 

 

 

RobertOdera
13 - Pulsar

Welcome to Alteryx @tww!

 

Check out the Parsing Tools --> Split to Columns

Go to Help --> Sample Workflows --> One tool at a time --> Parse --> Text to Columns (also see REGEX)

 

In the meantime, you can also use Regex + the formulas below in the Formula tool (you can use one formula tool, but I'm using many to step through for you 😎)

I hope you find it helpful - Cheers!

 

RobertOdera_0-1680301239239.png

 

tww
8 - Asteroid

Thank you @martinding , I heard Regex Tool is fairly power. It is a good time for me to learn.

tww
8 - Asteroid

Thank you @Amilley for the solution.

tww
8 - Asteroid

Thank you @RobertOdera  for the solution.

RobertOdera
13 - Pulsar

You're most welcome @tww!

Labels