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

Removing Text from Dataset

kamos
5 - Atom

I have a huge quantity of location ID codes that I am trying to turn into a usable format. My fields are consistently formatted as either:

 

ST-HI

ST-CA

ST-CO

ST-MD

ST-WY

 

OR

 

CO-AURORA

MO-STL

IL-CHICAGO

OH-DAYTON

 

I need to extract ONLY the state abbreviation. I think the best solution is to remove the "ST-" from the beginning of any relevant row. Then, remove everything after the "-" for all fields formatted as "STATE ABBREVIATION-CITY".

 

What is the best way to remove the "ST-" and also the "-CITY"? I am newer to Alteryx, but the tools I am trying give me poor results or affect things that I do not want them to affect.

 

I appreciate the help!

-K

 

 

3 REPLIES 3
acastelazo
8 - Asteroid

You can do this with a formula as long as the standalone states always begin with "ST" like this:

 

Capture.JPG

PhilipMannering
16 - Nebula
16 - Nebula

There are lots of way you could do it.

 

One way,

 

Regex out state - Capture.PNG

kamos
5 - Atom

Thank you PhilipMannering and acastelazo!!

 

I really appreciate the help!! 

Labels
Top Solution Authors