Alteryx Designer Desktop Discussions

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

Finding a substring within a string

PJ2020
5 - Atom

Hi All,

 

Appreciate if someone could help me with situation; this seems to be to be simple but I'm breaking a sweat.

Column 1 is what I have and column 2 is what I require; it always starts with text 'BudCod' and end with 4 digits total length is 10 and it can appear any part of the string

 

Column 1

Column 2

2020-08-ALP-venodr-BudCod1234-B241

BudCod1234

levelInfoBudCod1121, All- included

BudCod1121

Service vendor BudCod1217, all

BudCod1217

Supplier, excluding BudCod1351

BudCod1351

BudCod1782 vendorlevelinfo

BudCod1782

levelInfoBudCod1020Allincluded

BudCod1020

BudCod13200120200812467595

BudCod1320

9 REPLIES 9
atcodedog05
22 - Nova
22 - Nova

Hi @PJ2020 ,

 

Here is an approach for the task.

 

Use below pattern in Regex tool tokenize mode.

 

BudCod\d{4}

 

Config

atcodedog05_0-1601800829527.png

Output : 

atcodedog05_1-1601800850901.png

 

Workflow:

atcodedog05_0-1601802382663.png

Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind😀👍

Emil_Kos
17 - Castor
17 - Castor

Hi @PJ2020,

 

I have provided you with alternative solution.

 

I have use findstring to find where 'BudC' is located and afterwards I have used substring to show the string that you are interested in. 

 

Emil_Kos_0-1601801525992.png

 

atcodedog05
22 - Nova
22 - Nova

Interesting approach @Emil_Kos  🙂

Emil_Kos
17 - Castor
17 - Castor

Hi @atcodedog05,

 

Probably your is faster I need to learn more about the speed of each tool 🙂 

atcodedog05
22 - Nova
22 - Nova

@Emil_Kos 

 

Haha... It happens even i overcomplicate things sometime too when there is a easier way possible.

But its a great way of learning 🙂

tochy
8 - Asteroid

tochy_0-1601802210904.png

 

PJ2020
5 - Atom

Hi @atcodedog05,

Appreciate it! it's resolved the issue.

This is encouragement to explore more on RegEx, Thanks a Ton!  

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂

 

Cheers and happy analyzing 😀

PJ2020
5 - Atom

hi @Emil_Kos,

 

Thank you so much!

Smart solution, super helpful!

 

Labels