We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Removing Special Character "(c)"

Franzil
8 - Asteroid

Good day everyone,

 

I'm filtering previous queries re this specific problem but I can't find anything that will best match to my problem. I want to remove the special character at the end of my data specifically "(c)"

 

Sample data: HEFCL_1234567890_20230103 (c)

Desired Output: HEFCL_1234567890_20230103 

 

It tried some of formula in formula tool however, I did not get the desired output.

 

Samples:

Formula: REGEX_Replace([Comments/ ACES Loan number], "[^\w\s]",'')

Output: HEFCL_1234567890_20230103 c

 

Formula: REGEX_Replace([Comments/ ACES Loan number], "[^x20-x7e]+",'')

Output: HEFCL_1234567890_20230103c

 

Sample: REGEX_Replace([Comments/ ACES Loan number], "[^a-zA-Z0-9 -]", '')

Output: HEFCL123456789020230103 c

 

I also tried  the SUBSTRING, however it will also delete the last digit of my data when the data does not have a special character of "(c)"

 

Sample: Substring([Comments/ ACES Loan number],0,length([Comments/ ACES Loan number])-1)

Before: HEFCL_1234567890_20230103

Output: HEFCL_1234567890_2023010

 

I want an output that will remove the "(c)" without compromising other data that are already correct.

 

 

 

Thanks in advance!

Franzil

3 REPLIES 3
binuacs
21 - Polaris

@Franzil  Try the Replace() function

image.png

HomesickSurfer
12 - Quasar

Hi @Franzil 

 

Replace will work.

 

Or, have some fun with either Trim*, GetWord or ReverseString...

 

TrimRight([Field1],' (c)')

 

GetWord([Field1], 0)

 

ReverseString(GetWord(ReverseString([Field1]), 1))

Franzil
8 - Asteroid

@HomesickSurfer @binuacs This is great, thank you so much :)

Labels
Top Solution Authors