How do I get the characters before a specific character?

Options
zdlee
zdlee Member, ALL USERS Posts: 5 New Contributor

Let's say I have column username and a username is "JonSmith-81". What would be the formula to return just "JonSmith"?

Comments

  • jedwards
    jedwards Member, ALL USERS, Partner, Certified Master Anaplanner, Certified Model Builder Posts: 5 Certified Master Anaplanner

    @zdlee: try this formula given your example:

     

    LEFT(username, FIND("-", username) - 1)

  • jedwards
    jedwards Member, ALL USERS, Partner, Certified Master Anaplanner, Certified Model Builder Posts: 5 Certified Master Anaplanner

    @rob_marshall looks like you beat me to the answer!

     

    Correct me if I'm wrong, but text parsing is a pretty expensive operation and should be avoided or at least only performed in a system module (calc once and reference)?