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.
SOLVED

Remove all comma after a word

Ultralightbeam
8 - Asteroid

How to remove all comma from a string

InputOutput
Financial Force,,,,,Financial Force
Financial Force,Sales Force,,,Financial Force,Sales Force

basically removes all comma on the right side but not comma inbetween of a word

5 REPLIES 5
Emil_Kos
17 - Castor
17 - Castor

Hi @Ultralightbeam,

 

My solution works like this. If there 2 or more, I am removing them and as the last step, I am checking if the last sight is ' and if it is I am removing it as well.

 

Please let me know if this works for you. 

 

This is the output:

 

Emil_Kos_0-1611825403105.png

 

Ladarthure
14 - Magnetar
14 - Magnetar

Hi @Ultralightbeam,

 

here is my solution, I used regex to change multiple "," by one and then if it ends with a "," I just remove the last char.

 

 

Ultralightbeam
8 - Asteroid

@Emil_Kos 

I just found out that I also have two or more commas inbetween the words

InputOutput
Financial Force,,,,,Financial Force
Financial Force,Sales Force,,,Financial Force,Sales Force
Financial Force,,Sales Force,,Financial Force,Sales Force
Emil_Kos
17 - Castor
17 - Castor

Hi @Ultralightbeam,

 

Small amendment and it works

 

Emil_Kos_0-1611826059436.png

 

Ladarthure
14 - Magnetar
14 - Magnetar

@Ultralightbeam,

 

additionnaly, you could use the function

 

TrimRight([Field1], ',')

 

which will remove the character specified on the right of your field! (there is also trimleft for the left part and trim to trim both on the left and the right

 

Have a great day

Labels
Top Solution Authors