Hello, I have a dataset like this, and I need to trim it in the right. The only pattern is that, there will be a bracket in the end.
I used Text to column, but i would like to know if there's a better way, in case there are 3 brackets in the future.
String | Extract |
abc(999) | 999 |
xopo(iioie)dfdfdf(000A) | 000A |
opop-(,mmm)xoxoxo(BBB123) | BBB123 |
I am not sure how to use Alteryx to do this... would appreciate help, thanks!
Solved! Go to Solution.
@lolwat00000
use this regex formula in formual tool
REGEX_Replace([String], ".*\(([^()]*)\)[^()]*$", "$1")
find workflow attached for reference
mark done if solved.
Hi @lolwat00000,
I am no Regex expert by any means, but this got the desired output: \((\w*+\d*)\)$
Insert a regex tool and select parse.
Regex is great. Here is an option if you wanted to do it as a formula:
Substring([String],
//Find start point.
Length([String])-FindString(ReverseString([String]), '(')
//Subtract end point from start point to get length.
,(Length([String])-FindString(ReverseString([String]), ')'))
-
(Length([String])-FindString(ReverseString([String]), '('))
-1)
REGEX_Replace([MyField], ".*\((.*)\)$", "$1")