1 Reply Latest reply: May 15, 2014 9:58 AM by Mike Urbonas RSS

    split 1 field into 2

    helpless _

      I have a mbr name field, always last name, firstname.

       

      is there any way to split at the comma to create 2 seperate fields (last name, first name)?

        • split 1 field into 2
          Mike Urbonas

          Originally posted by bls:

          I have a mbr name field, always last name, firstname.

           

          is there any way to split at the comma to create 2 seperate fields (last name, first name)?[/b][/quote]Yes.  In your model, just capture the entire name as one field (call it "Name").  Then in the Table view, take a look at the LSPLIT function.

           

          The Calculated Field formula:

           

          LSPLIT(Name,2,",",1)

           

          will get the last name (Formula is telling Monarch "Split the Name field into 2 strings, whereever the comma appears.  Then display the first of the two strings.")

           

          and this formula:

           

          LSPLIT(Name,2,",",2)

           

          will get the first name.  If there is a space after the comma and before the first name, this will get rid of that space:

           

          LTRIM(LSPLIT(Name,2,",",2)

           

          Regards

          Mike