Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Removing everything before/after a particular character

How can I remove everything before a particular character (including that character)? So, I have 'Johnson, John' and want to have only 'John'?

 

Thank you! 

6 REPLIES 6
atcodedog05
22 - Nova
22 - Nova

Hi @veronikababiciute 

 

I am guessing you want to remove everything before comma. Use below formula

 

REGEX_Replace([Field1], "(.*,\s)", "")

 

Workflow:

atcodedog05_0-1628867682290.png

 

Hope this helps : )

messi007
15 - Aurora
15 - Aurora

@veronikababiciute,

 

You can use RegEx

 

messi007_0-1628867617242.png

Attached the workflow.

 

Hope this helps!

Regards

Maskell_Rascal
13 - Pulsar

Hey @veronikababiciute,

 

Both of the RegEx solutions provided will work, and I'm a big advocate for using it when I can. But just incase you aren't well versed in RegEx, let me provide an alternative solution that looks a little more like a traditional Excel formula. 

 

Substring([Field1],FindString([Field1], " ")+1,Length([Field1]))

 

This formula is similar to the MID function in Excel. I'm using a FindString function to get the position of the first space, I then add one to it to specify my starting position, and finally the length is just the remaining characters in that field.  

 

Maskell_Rascal_0-1628868987355.png

 

Cheers!

Phil

 

 

 

Hello Maskell, 

 

Thanks a lot for the solution! 

 

What would change if I wanted to keep Smith instead of John? Thanks!

atcodedog05
22 - Nova
22 - Nova

Hi @veronikababiciute 

 

Can you provide more clarity what do you mean keep Smith from John Smith?

Would the input name be John, Smith (current scenario as above input with comma inbetween) or John Smith?

Maskell_Rascal
13 - Pulsar

Also, for clarity, since it wasn't in the example I provided. The name I was parsing was "Adams, John Smith". So it is technically doing what you asked. I was merely showing an example of how it will search for the first space it can find and leave the rest. So if you had someone with the first name of Billy Bob, it will still maintain their full name. 

Labels