Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Remove bracket with text at the end

sirsjat21
5 - Atom

Hi All,

 

I am pretty new alteryx and need your help on below.

 

I have below input data:

ABCD (Merged)

XYZ (Converted)

DBC (Demerger) Pacific

 

I want below output:

 

ABCD

XYZ

DBC (Demerger) Pacific

 

 

So basically I want to remove bracket along with text inside at the end of the string. Leaving any brackets between or beginning.

 

Please help.

 

 

6 REPLIES 6
ShankerV
17 - Castor

Hi @sirsjat21 

 

This can be achieved with using the Regex tool.

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @sirsjat21 

 

Please find the solution worked for your reference.

 

ShankerV_0-1670395656034.png

 

 

Hope your issue is resolved. Feel free to mark helpful answers as a solution, so that future users with the same issue can find them easier!!!!

 

Many thanks

Shanker V

ShankerV
17 - Castor

@sirsjat21 

 

Breaking down how my regex works.

 

(\s\(\w+\))

The above \s finds for the space

\( Finds for the open parenthesis

As I have grouped, it checks for \s\(

 

Then any characters inside the parathesis are read by \w and looking for the closing parenthesis \).

 

I have used the output method as Replace, which will replace with Null as I have not entered any Replacement Text.

 

For more resources on how to write regular expressions, visit https://regex101.com/

 

Many thanks

Shanker V

 

 

 

 

binuacs
21 - Polaris

@sirsjat21 One way of doing this

binuacs_0-1670407280022.png

 

ShankerV
17 - Castor

@sirsjat21 

 

Please find the revised solution where you wanted to remove only the ending word with brackets.

 

ShankerV_0-1670408742429.png

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

@binuacs 

 

I read all of your solutions, A new way to approach using the formula tool. Thanks.

 

Many thanks

Shanker V

Labels