Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to flip last name, first name middle name

ramosjaqueline12
6 - Meteoroid

Hi, I am new to alteryx. Is there a formula I can use to flip last name and first name? In Excel I was using the following formula [=MID(A2&" "&A2,FIND(" ",A2)+1,LEN(A2))].

 

My data has a column for full name, where the format is "Castoral, Darren Andre" or "Lopez, Anna M" and I would like to have it flipped to be "Darren Andre Castoral" and "Anna M Lopez". Thanks!

8 REPLIES 8
BrandonB
Alteryx
Alteryx

Name Switch.png

 

Example solution and workflow attached!

kelsey_kincaid
12 - Quasar

Hi @ramosjaqueline12 ,

I would suggest using the 'Text To Columns' tool to split the name where there's a comma, then a formula tool to concatenate them back together int he order you're looking for. Screenshot below.

kayers_0-1578336816603.png

NickSm
Alteryx
Alteryx

@ramosjaqueline12 

 

As with most things in Alteryx, lots of ways to do it.  Here's a one-tool example using regular expression attached.

 

regex_rearrange.PNG

BrandonB
Alteryx
Alteryx

Name Switch V2.png

 

Also, if you are more familiar with Excel functions, you might find that the substring function is closer to what you are used to. 

ramosjaqueline12
6 - Meteoroid

Thanks so much!

Both suggestions work and even though I am more familiar with Excel it seems like the text to columns solution is way simpler.

ramosjaqueline12
6 - Meteoroid

Thank you Nick! I was trying to figure out the RegEx formula but I am still trying to learn about all the options available in Alteryx. This example helps me a lot as well.

melaniaserviss
7 - Meteor

This is so awesome, thank you for posting. I was playing with RegEx the past 2 days but nothing worked right.

crshep2021
5 - Atom

Exactly the solution I was looking for! Thanks for posting. Does anyone know how to do this with multiple names in one field? Each of the names are separated by a semi-colon ;  i.e. Doe, John; Last Name, First Name; 

Labels