Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Text Parsing Help Please!

kkkim
8 - Asteroid

Hi, Alteryx Community!

 

I need to parse out the string that starts with "USD" from below. Any ideas on how to do that using Parse Tool? Thank you so much for your help in advance!!!!

 

Original String:

ABC EFG 1234 56 1A USDAAA 12345

ABC EFG 1234 56 1A USDBBB 12345

 

 

Need to Parse:

USDAAA

USDBBB

2 REPLIES 2
MarqueeCrew
20 - Arcturus
20 - Arcturus

@kkkim ,

 

In your example (above) the USDAAA is always the same length and in the same position....  so you could use a substring() function in a formula as:

 

 

Substring([String Field],19,6)

 

 

If the field is "flexible" (length = 6), you could use a formula like:

 

Substring([String Field], Findstring([String Field], "USD"),6)

 

 

or you could play with a Regular Expression as:

 

 

Regex_Replace([String Field], ".*\s(USD\w+)\s.*",'$1')

 

 

The RegEx is most flexible, but hardest to explain to your boss.  it finds a group of letters/numbers preceded by USD until the following space.

 

Cheers,

 

Mark

 

P.S.  I didn't test these formulas.  They might need a little TLC.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
kkkim
8 - Asteroid

Thank you so much!!!

Labels