Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6187 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

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

        n = ValueCount ( words ) ] ; 

   GetValue ( words ; n )  )

Posted

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

Fitch your code worked perfectly. Thank you very much.

CMack

Posted (edited)

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

This topic is 6187 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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