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

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
binuacs
21 - Polaris

@KamenRider Try 

 

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

KamenRider
11 - Bolide

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

 

Kamen

binuacs
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