Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Separating last name

Featured Replies

I am trying to parse the last name out of a full name field.

I am using

Right(FullName; Length(FullName) - Position(FullName; " "; 1; 1))

It mostly works but here is my trouble.

I have names such as

John Smith

John W. Smith

John Smith-Jones

John W. Smith-Jones

I seem to be able to account for some of the combinations but not all of them. The calculation in the DB returns

W. Smith-Jones

So I tried making the " " to "." but that only works if there is a Middle initial and it leaves a space before the last name.

Any help would be greatly appreciated.

Cmack

try

rightwords(name,1)

I just tried it on John w. simth-jones and it return the last name "Jones"

Hope this helps

I think what you'd want there is "Smith-Jones" rather than "Jones." So:

Let( [ words = Substitute ( name ; " " ; ¶ ) ; 

        n = ValueCount ( words ) ] ; 

   GetValue ( words ; n )  )

  • Author

Thank you both and yes I would need the whole name Smith-Jones.

Fitch your code worked perfectly. Thank you very much.

CMack

Parsing names can be tough. What happens to Mr. von Helsing and to Cher?

Better to have two fields to begin with.

  • Author

Yes I agree that having 2 fields to begin with is optimal. I have to import the data from another file and that file has the names in one field and I have no control over the format.

Hopefully Cher will never work for my school and Mr. Von Helsing's skill would best be learned at a high school. :-)

Edited by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.