Alteryx Designer Desktop Discussions

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

Removing only some Characters

tycarbone
6 - Meteoroid

Hello,

 

I have a dataset where some names have a random letter in front of them and others do not. For example:

 

A Michael Scott

L Dwight Schrute

Pam Beasley

S Jim Halpert

 

How do I remove only the leading single letters from Michael, Dwight and Jim without removing the first letter in Pam's name.

 

Thank you!

5 REPLIES 5
dougperez
12 - Quasar

Hello!

Try to use regex (see the attached workflow)

 

 

dougperez
12 - Quasar

And I loved te reference!!!

Dwight loves regex (i think) 

dwight.png

atcodedog05
22 - Nova
22 - Nova

Hi @tycarbone 

 

Character name from The Office one of my favorite show.

 

You can trim the start by using this formula

IF FindString([Field1], " ")=1 THEN 
Right([Field1], Length([Field1])-2) 
ELSE [Field1] ENDIF

It checks whether the 2nd char is space if yes then remove first 2 chars.

 

Workflow:

atcodedog05_0-1621021046550.png

 

 Hope this helps 🙂

atcodedog05
22 - Nova
22 - Nova

@dougperez wrote:

And I loved te reference!!!

Dwight loves regex (i think) 


Or we can trick him into using RegEx 😜😜😂😂

tycarbone
6 - Meteoroid

This worked like a charm! I agree, Dwight would love Regex!

Labels