Forum Discussion

jmetf150's avatar
jmetf150
Helper I
2 years ago
Solved

Replace First Name Last Name with First Initial Last Name;

Is there a simply way to do this in "Transform Data" or would you recommend a certain function/formula?

 

 

CodeFirst & Last NameDesired Output (Relplace Text not create new column)
G14Clarence CarterC. Carter
MIAChuck NorrissC. Norriss
MIBWill SmithW. Smith
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  jmetf150 ,

     

    Here are the steps you can follow:

    1. Create calculated column.

    Test =
    var _find=
    SEARCH(" ",[First & Last Name],1)
    var _len=
    LEN([First & Last Name])
    var _test=
    RIGHT(
        [First & Last Name],_len-_find)
    return
    LEFT(
        [First & Last Name],1)&". "&_test

    2. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  jmetf150 ,

     

    Here are the steps you can follow:

    1. Create calculated column.

    Test =
    var _find=
    SEARCH(" ",[First & Last Name],1)
    var _len=
    LEN([First & Last Name])
    var _test=
    RIGHT(
        [First & Last Name],_len-_find)
    return
    LEFT(
        [First & Last Name],1)&". "&_test

    2. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly