cancel
Showing results for 
Search instead for 
Did you mean: 

Extract first name & last name

SudheerReddy
Level 4
What is the best way to extract first name & last name? Full name was like 'Last, First Mid' or 'Last, First'. I was using Trim, InStr, Replace...types of functions which is creating issues. For some transactions, it's fetching the correct data. For some, it's fetching only a part of the required name and for some, it's throwing an error that the . I'm looking for a standard way to extract this data.
3 REPLIES 3

Denis__Dennehy
Level 15
You probably will be able to do it with decision and calculation stages - you just need to experiment a lot and test your logic against as many different examples of the text as possible.  The errors you are getting simply suggest your InStr logic for finding commas or spaces needs improving. Off the top of my head - getting the last name should be easy thanks to that comma.  Something like: Trim(Left([NameText],InStr([NameText,"","")-1)) For the first names you need some kind of logic that extracts the positions of all the spaces (the gaps between first names - there could be more than just two) - and they loop through extracting each name.

SudheerReddy
Level 4
Thanks for the reply Denis. I'll try this.

Anonymous
Not applicable
thanks