Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Parse Constant String from a Column

mystasz
8 - Asteroid

Hello,

 

In the attached sample dataset, I'm trying to parse column "Field 1". I'd like to parse out the T100 #s. Some may be null because it does not exist. The final output column should have T100-#####.

 

Thanks!

4 REPLIES 4
MilindG
12 - Quasar

MilindG_0-1661442924752.pngMilindG_1-1661442947929.png

 

mystasz
8 - Asteroid

That was easier than I was making it.. Thank you!

DataNath
17 - Castor
17 - Castor

If the target IDs are always that consistent 10-character T100-X, then this ought to work:

 

IIF(FindString([Field 1], 'T100-')>-1,Substring([Field 1],FindString([Field 1], 'T100-'),10),null())

 

DataNath_0-1661443306540.png

srvas17
7 - Meteor

Just to add a layer of capability for other users trying to do the same, I find this site great to test and develop more complicated Regex to feed the tool:  regex101: build, test, and debug regex

Labels
Top Solution Authors