Alteryx Designer Desktop Discussions

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

Remove special characters

swapsingh2712
8 - Asteroid

Hello All,

 

I've a analytical app which is taking the input from the user. Here's the sample data

 

Test IDTest NameSample Size 
121My-Test_1100 
122My-test 2@70 
123sample-test40 

 

As you see for test ID 122 there's a special character which I need to remove using alteryx. My workflow should remove special characters from the start and end of the test name (Ltrim and Rtrim), but it should not remove the characters like  '-', or space.

 

Please advise.

3 REPLIES 3
ShankerV
17 - Castor

Hi @swapsingh2712 

 

Can I consider _ as special character or keep in the output.

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @swapsingh2712 

 

Solution:

 

The below will eliminate the @ and any other from the incoming string.

 

ShankerV_0-1673516015890.png

 

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

 

ShankerV_1-1673516044494.png

 

 

Feel free to mark the solution of the post which helped to resolve the issue, so similar issues faced by other community members in future can be helpful to refer the solution.

 

Many thanks

Shanker V

 

 

binuacs
20 - Arcturus

@swapsingh2712 you can also use the function ReplaceChar()

 

ReplaceChar([Test Name],’@?!_‘.’’)

Labels