Jump to content

Concatenating First and Last Name


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

Recommended Posts

I am using a calculation field to combine first and last name.  The calculation (First Name & " "  & Last Name) works fine when the last name contains no blanks or hyphens.  When the last name contains a space or hyphen between two words, such as in "De Liban" or "De-Liban", the calculation drops everything after the space or hyphen.  What can be done about this besides the obvious of not using spaces or hyphens in the last name?  Thanks everyone.

Linda

Link to comment
Share on other sites

To expand on Bruce's reply - that calculation, as shown, will not behave as described. It will definitely put the First Name and Last Name together in full.

I suspect this is to do with the display of the results afterwards - attached is the result of that calculation, displayed in three different ways on a layout. The middle one still has the full text, but it is cut off by the size of the field.

A more esoteric possibility may be that the calculation also has some form of LeftWords calculation applied to it.

Screen Shot 2016-01-08 at 8.18.51 am.png

  • Like 1
Link to comment
Share on other sites

Make sure the result is "text" not "number" as the hyphen may treat it as a calculation 

I prefer, this method.

Trim (  Substitute ( List ( Trim (GetValue ( FirstName; 1) ) ; Trim ( GetValue (LastName;1) ) )  ; "¶" ; " " )  )

Ensures you only get the first line of text from each field and removes trailing spaces and then only ads a space if both names are present. 

Link to comment
Share on other sites

5 hours ago, Ocean West said:

Make sure the result is "text" not "number" as the hyphen may treat it as a calculation 

No, that is not possible. A text character will never be treated as an operator, unless you coerce the text to become a formula by passing it as the parameter to the Evaluate() function. 

 

 

  • Like 1
Link to comment
Share on other sites

This topic is 3123 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.