Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Split String Fields in parenthesis From the Right

dataviolet
7 - Meteor

Hello all,

 

I have data that looks like this:

 

ABC Corp (SAP 100) (20)

DEF (19)

GHI Inc HQ (190)

LMN (US) Holdings (SAP 2000) (1)

 

I want to get rid of only the last set of numbers in the string and keep the rest, so in the example above, I would want to get rid of:

(20)

(19)

(190)

(1)

 

I think the way I would do it is via RegEx, but not sure how to set it up. Would appreciate any assistance.

 

5 REPLIES 5
JosephSerpis
17 - Castor
17 - Castor

Hi @dataviolet I mocked up a workflow let me know what you think?

rituraj963
8 - Asteroid

Hi @dataviolet,

 

I am not sure if Text to Column tool would do any trick here. I wrote some calculations in a Formula tool and it is extracting the text as you wanted. Please refer this workflow.

 

Let me know how it goes.

 

-Rituraj

dataviolet
7 - Meteor

Thank you, Rituraj! this is exactly what I was looking for. Could you also please explain to me the syntax that you used in the regex? Does the \s\ stand for text, and the \d stand for digits or something?

 

\s\(\d+\)

JosephSerpis
17 - Castor
17 - Castor

The Regex \s\(\d+\) will search for a space \s a bracket \( then a digit \d the + means one or more, so in this case one or more digits then another bracket \)

dataviolet
7 - Meteor

Thank you, Joseph, for the detailed breakdown!

Labels