Alteryx Designer Desktop Discussions

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

Removing employee name with certain criteria

SH_94
11 - Bolide

Dear Community,

 

I would like to ask how can we remove the original data as below to produce the desired result.Basically i want to remove all the name within the bracket including the brackets as well.

Original Data

1. Tang Ong Ong , Ong ( Gliva)

2. Lau Lang Lang , Alica ( Lang Lang)

3. Hung Hung ( Oliver)

 

Desired Result

1. Tang Ong Ong , Ong

2. Lau Lang Lang , Alica

3. Hung Hung

 

 

Thank you.

3 REPLIES 3
Elias_Nordlinder
11 - Bolide

Hello @SH_94 ,

 

What about something like this 🙂

You can use the RegEx_Replace function in the formula tool to get rid of the brackets and what is in there.

 

One formula you can use is as below
RegEx_Replace([Name],"(.*)\s\(.*","$1")

 

1. .*      Everything before a specific space

2. \s      Space

3. \(       First paranthesis

4. .*      Everything after paranthesis

5. $1    Replace with the first bracket

 

 

Elias_Nordlinder_0-1627361227365.png

 

 

Elias_Nordlinder_1-1627361162789.png

 

 

Elias_Nordlinder_1-1627361310603.png

 

Let me know if you have any more questions or if this answer your request! 🙂

//Best Regards
Elias

MarqueeCrew
20 - Arcturus
20 - Arcturus

@SH_94 ,

 

 try findstring([data], " (")


it becomes(

 

left([data], findstring([data], " ("))

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
atcodedog05
22 - Nova
22 - Nova

Hi @SH_94,

 

My take on this. 

 

Formula:

REGEX_Replace([Field1], " \(.*\)", "")

 

Workflow:

atcodedog05_0-1627368164507.png

 

Replace leading space + characters in between brackets to no string.

 

  space

\( open bracket

.* any characters

\) closed bracket

 

Hope this helps : )

 

Labels