Hi Am trying to achieve the attached. Please help why alteryx reading like this city brackets missing and "\" character also adding.
Solved! Go to Solution.
Hi!
I suspect your issue is around the fact that both \ and | are special characters in RegEx and need to be escaped in your formula. The below should work for your requirements:
REGEX_Replace([Id],'(.*\|)(.*)','$1') + [City]
(.*\|) - The brackets denote the first captured group, .* - zero or more of any character, up to and including |. Using the \ to escape the | special character so that Alteryx isn't recognising it as an OR function.
(.*) - Second caputed group, in this case everything after the |
Adding city in the function after the RegEx means you'll get the whole field rather as required and it wont be evaluated as part of the RegEx.
Happy to help : ) @sreejithmp
Cheers and have a nice day!
User | Count |
---|---|
52 | |
27 | |
25 | |
24 | |
21 |