Hello
I have two columns with names where each record ends with some text in brackets. It looks like that "Paul Novak(ABC)" or "Paul Novak (BA)".
I would like to remove to all statements in brackets from the string but there is some problem in replace function.
How can I write expression to get rid of it?
Solved! Go to Solution.
Here's a regular expression for you:
Regex_Replace([Field1],"(.*)\s*\(.*",'$1')
It will take everything until it hits the "last" open parenthesis. Edited to include with or without a space.
Cheers,
Mark
The only thing I would add to @MarqueeCrew's wonderful solution would be to surround that function with the Trim function in case there are any trailing spaces left after the RegEx.
trim(Regex_Replace([Field1],"(.*)\(.*",'$1'))
Thank you guys. I have also one question: how to make email from this output? Something like Paul.Novak@abc.com
If a field always appears as "fname lname", there are many ways.
Replacechar([Field1]," ",'.') +"@abc.com"
That's just one way.
Cheers,
Mark
Thanks, I have already made it with Regex_Replace.
Hello, that's me again.
What when I would like to create new columns from Paul Nowak?
Something like this:
Paul Novak | Paul | Novak |
I was trying to made it with formula tool, name extraction is easy but I have problem with writing expression for surname.
Sorry for this asking&asking but this is my first day with alteryx software in my work.