Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Filter or Remove Unwanted Letters or Characters Leaving Data in Row

sslattery17
8 - Asteroid

My input source has a column with primary name and/or residents.  The client sometimes uses designations (H) or (H) Shannon**Slattery** to identify the tenants unit type etc...I have tried to filter this out a few different ways including using regex_replace([Residents],"[^\sa-zA-Z]",'') or regex_replace ([Residents],"(H)",'')  I need the tenant name to stay but any and all designations to be removed.  I even tried the find replace and that did not work as expected.  I have attached screenshots.  With 6 weeks into the use of this tool; any guidance suggestions, would greatly be appreciated.  

Screenshot 2024-09-19 121506.png

Screenshot 2024-09-19 121542.png

  

34 REPLIES 34
binuacs
21 - Polaris

@sslattery17 use the replace funtion

image.png

ChrisTX
16 - Nebula
16 - Nebula

Try a few formulas

 

Create a new field New Name

 

Replace([Primary Name], "(H)", "")

REGEX_Replace([New Name], "[^a-zA-Z0-9 ]", "")

Trim([New Name])

 

Check out all of the available Functions here: Functions (alteryx.com)

 

Screenshot 2024-09-19 144931.png

 

Chris

sslattery17
8 - Asteroid

I used the following

 

replace([Primary Name],'(H)', "") and it removed the (H); I used same replace formula to try and remove the ** as shown below; but it removed all the names or replaced them with 0.

 

I used same replace formula to try and remove the ** as shown below; but it removed all the names or replaced them with 0.

 

replace({Primary Name], "**", "") 

 

**Kimberly** Elam
Alexandria** Mickens
Kevin** Hanks

 

Also tried 

and also regex_replace([Primary Name], "[^a-zA-Z0-9 ]", "") That left the ** and the (H).

 

 

sslattery17
8 - Asteroid

The replace formula for the (H) worked but the regex formula did not work for removing the ** from any part of the name.

sslattery17
8 - Asteroid

After cleaning up a few formulas in my workflow and moving a few around; both formulas as noted in this feed worked to remove/replaced the unwanted characters without filtering out the data.  Thanks for the help. 

sslattery17
8 - Asteroid

Sample Data for review

binuacs
21 - Polaris

@sslattery17 what is the expected result?

sslattery17
8 - Asteroid

All sample files

binuacs
21 - Polaris
Labels