In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Extracting Text After the Second Underscore

KamenRider
11 - Bolide

Hi Guys,

 

I would like to ask for your ideas on how to get the text after the underscore. For example

 

BPOPHASE_145_H2

BPOPHASE_146_P2

BPOPHASE_18_X

 

RESULTS SHOULD BE

H2

P2

X

 

Thanks and looking forward for your response.

Kamen

 

 

3 REPLIES 3
binu_acs
21 - Polaris

@KamenRider Try 

 

Regex_Replace([Field],”.*_(.*)”,”$1”)

KamenRider
11 - Bolide

Nice @binu_acs. However can you please explain to me this formula - Regex_Replace([Field],".*_(.*)","$1") on how you derived the solution?

 

Kamen

binu_acs
21 - Polaris

@KamenRider  The Regex split the given string in to two part, the first part is .*_ , which is any characters before the last “_” and the second part is any characters after the last “_”. Since I gave the second part inside the brackets (.*) and the $1 will output only  whatever inside the bracket

Labels
Top Solution Authors