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

Isolating first and last words in string

rwelman003
5 - Atom

Hi there,

 

I am trying to isolate the first and last word in a string. I have data of names and some names include middle names or nicknames The names can vary up to 5 words.... I first tried to do text to columns but then I don't know how to get the surname of the shorter names under the right column. I then tried to use the RegEx function to parse the first and last names but have been unsuccessful in writing a formula. Please can someone assist?

 

Thanks!

13 REPLIES 13
atcodedog05
22 - Nova
22 - Nova

Hi @lisebiss 

 

Case 1: there is 3 words. Specifying "3" will return 3rd word. "-1" will return last word i,e 3rd word.

Case 2: there is 4 words. Specifying "3" will return 3rd word. "-1" will return last word i,e 4th word.

lisebiss
6 - Meteoroid

Crystal clear, thank you all!!

jassik
8 - Asteroid

Many Thanks , I was struggling a lot with the last names to get them. It worked perfect for me🤗

brandonbocking
5 - Atom

Yes that is right, but sometimes you want the last word only and cells can contain various number of words from row to row.

Labels
Top Solution Authors