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

Remove string phrase that has underscores

nsarayar
7 - Meteor

Hi

 

I need to remove the string text "BUORG" and then the next string, whatever that may be, that has underscores in all the columns but can't work out how to do that. Any ideas?

 

Source

Business Unit

Business Unit Level 2 Description

Business Unit Level 3 Description

Business Unit Level 4 Description

Business Unit Level 5 Description

FGAEQ

BUORG ORG_MFG MAT ASSET MANAGEMENT

BUORG ORG_MFG_MAT MAT INVESTMENT MANAGEMENT

BUORG ORG_MFG_ASIA MIP ASIA

BUORG ORG_MFG_ASIA_EQ EQUITIES

 

Final

Business Unit

Business Unit Level 2 Description

Business Unit Level 3 Description

Business Unit Level 4 Description

Business Unit Level 5 Description

FGAEQ

MAT ASSET MANAGEMENT

MAT INVESTMENT MANAGEMENT

MIP ASIA

EQUITIES

 

5 REPLIES 5
OllieClarke
15 - Aurora
15 - Aurora

@nsarayar try this in a multi field formula tool, ticking the columns you want:

TRIM(REGEX_REPLACE([_currentfield_],'BUORG \w+',''))

 

This will replace all letters, numbers and underscores following BUORG with nothing

atcodedog05
22 - Nova
22 - Nova

Hi @nsarayar 

 

You can use multi-field formula tool and regex_replace for this usecase.

 

Workflow:

atcodedog05_0-1632152264387.png

 

Edit : I updated my solution after seeing @OllieClarke response 😅 now its the same.

 

Hope this helps : )

 

atcodedog05
22 - Nova
22 - Nova

Hi @OllieClarke 

 

Interesting i didn't know \w includes underscore _. I checked now in the Regex tool to confirm after seeing your response.

 

Thank you for the share 🙂

nsarayar
7 - Meteor

Thank you!

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @nsarayar 

Cheers and have a nice day!

Labels