community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Removing Text from Dataset

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

 

 

Asteroid

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

 

Capture.JPG

Alteryx Certified Partner

There are lots of way you could do it.

 

One way,

 

Regex out state - Capture.PNG

Highlighted
Atom

Thank you PhilipMannering and acastelazo!!

 

I really appreciate the help!! 

Labels