2 Replies Latest reply on Oct 29, 2013 12:23 PM by Willz

    Separate one field into two fields of data

    Willz

      Title

      Separate one field into two fields of data

      Post

           What is calculation to separate first name, last name from full name field

        • 1. Re: Separate one field into two fields of data
          philmodjunk

               It's MUCH easier to do the reverse: Enter data into separate fields and then use a calculation to combine them.

               What makes this a messy situation to split them is that names don't all fit the same pattern. A first or a last name might actually be two words instead of one.

               FirstName:

               Let ( NameList = Substitute ( FullNameFieldHere ; " " ; ¶ ) ;
                        GetValue ( NameList ; 1 )
                     )

               Last Name:

               Let ( [ NameList = Substitute ( FullNameFieldHere ; " " ; ¶ ) ;
                         LastName = RightValues ( NameList ; ValueCount ( NameList ) - 1 )
                       ] ;
                       Left ( LastName ; Length ( LastName ) - 1 ) //strips off extra return character put at end of text by RightValues function
                      )

               Example:

               If text in FullName field is: "The Artist Formerly Known as Prince". You'll get a First Name of "The" and a Last Name of "Artist Formerly Known as Prince". wink

          • 2. Re: Separate one field into two fields of data
            Willz

                 Perfect!!

                 that did it - I just have to edit a few instead of 4000.

                 Thank You