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 Commas

dpatel53
6 - Meteoroid

Hi, 

This might be really simple but I wanted to remove commas that were by themselves on empty columns. I will provide a picture below for more context

dpatel53_0-1662581045470.png

I want to keep the commas if there is a name next to it but remove the commas on ones that don't. Thanks in advance!

3 REPLIES 3
chuckleswk
11 - Bolide

You can use the following formula:


if length(trim([BL2Final])) = 1 then regex_replace(trim([BL2Final]),',','')
else [BL2Final]
endif

Remove Commas.PNG

 

Or you can use the Multi-Field Formula to do the same:

if length(trim([_CurrentField_])) = 1 then regex_replace(trim([_CurrentField_]),',','')
else [_CurrentField_]
endif

Remove Commas.PNG

 

 

Emmanuel_G
13 - Pulsar

Hi @dpatel53 ,

 

For the lines which had commas only, we assign a null value and for those where we had names, the commas in prefix are kept.

 

Find attached a way to do this

 

Emmanuel_G_0-1662581679025.png

 

grazitti_sapna
17 - Castor

@dpatel53 , You can easily achieve it by using Multi Field Formula. Sharing the workflow on same. Please accept my solution if it helped you.

 

Thanks!!

Sapna Gupta
Labels
Top Solution Authors