Alteryx Designer Desktop Discussions

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

Extracting Text After the Second Underscore

KamenRider
Bólide

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 RESPOSTAS 3
binuacs
Arcturus

@KamenRider Try 

 

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

KamenRider
Bólide

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

 

Kamen

binuacs
Arcturus

@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

Rótulos