We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Parsing for Each Row

rmartinez4
8 - Asteroid

Hi All,

 

I want to parse out a specific data out of this cell in each row which is delimited by comma but the data will never be aligned or separated using to text to column tool. I was hoping it can be done with REG EX by parsing out since the data will always start with , BU-007-WFBA1,  and end with the comma. The data should be placed in a new column or field called business unit. 

 

 

Yellow1, Red3, Main Column, Sun Drive, 013, BU-007-WFBA1, TUFF123, ITEM-OPAC, RTF1918 10, STUN!

Main Column, West Drive, 113, BU-003-WTA1, TUFF133, ITEM-OPAC, RTF0012 10, TY122, TOPPIN1

Sub Column, TUYH, Main Column, East Drive, 123, BU-012-WFBA3, TUFF123, ITEM-OPAC, RTF1918 10, 0SLOPE

Main Column, Sun Drive, 013, BU-007-WFBA1, TUFF123, ITEM-OPAC, RTF1918 10, FAX123

Globe3, Main Column, Sun Drive, 013, BU-007-WFBA1, TUFF123, ITEM-OPAC, RTF1918 10, Earth1

 

 

Thank You,

 

7 REPLIES 7
MarqueeCrew
20 - Arcturus
20 - Arcturus

What does the result look like?

Alteryx ACE & Top Community Contributor

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

Result should look like this.

 

rmartinez4_0-1661258536132.png

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@rmartinez4 ,

 

Inside of a formula tool, this expression will find what you are looking for:

 

REGEX_Replace([Data], ".*,\sBU-\d\d\d-(.*?),.*", '$1')

 

Sorry for the exact answer and not having an explanation.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

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

Thank you it worked! One last question now if the data does not contain a  ",BU-" can it return "Not Found" in this expression. 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@rmartinez4 ,

 

Another expression:

 

IIF([Data] == [Result], "Not Found", [Result])

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

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

Worked like a charm! You earned a subscriber on YouTube. Thank you so much!

rmartinez4
8 - Asteroid

Is possible to modified expression to leave the codes - final result should look like 007-WFBA1. 

Labels
Top Solution Authors