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

How to remove "," from the field

srk0609
8 - Asteroid

I want to remove unwanted "," from the field Elimination reason. There are "," at the beginning and end and in middle. Can someone help me remove them and make the data clean?

Example
1 Due to Code Name , , , ,Not Enabled - In this text I just want 1 comma and the final text to look like "Due to Code Name , Not Enabled"

2  , , , ,Not Enabled - I want to remove unwanted commas in the beginning the final text should look like "Not Enabled"

3 ,Since it is a Parent , , , - I want to remove unwanted commas the final text should look like  "Since it is a Parent"

4 Due to Code Name , , , , - I want to remove unwanted commas the final text should look like "Due to Code Name"

5

I want to remove unwanted "," from the field Elimination reason. There are "," at the beginning and end and in middle. Can someone help me remove them and make the data clean?

Example
1 Due to Code Name , , , ,Not Enabled - In this text I just want 1 comma and the final text to look like "Due to Code Name ,Not Enabled"

2  , , , ,Not Enabled - I want to remove unwanted commas in the beginning the final text should look like "Not Enabled"

3 ,Since it is a Parent , , , - I want to remove unwanted commas the final text should look like  "Since it is a Parent"

4 Due to Code Name , , , , - I want to remove unwanted commas the final text should look like "Due to Code Name"

5 ,Since it is a Parent , ,Due to Ledger Name , - I want to remove unwanted commas the final text should look like "Since it is a Parent ,Due to Ledger Name"

6 Due to Code Name ,Since it is a Parent , ,Due to Ledger Name , - I want to remove unwanted commas the final text should look like "Due to Code Name ,Since it is a Parent  ,Due to Ledger Name"

I'm attaching below my Alteryx workflow and Excel output file

8 REPLIES 8
alexnajm
18 - Pollux
18 - Pollux

Trim([field],",") will get rid of them at the beginning and end

 

Then you can use Regex_Replace after to replace multiple commas with one comma - something like RegEx_Replace([field],",+",",")

srk0609
8 - Asteroid

Tried doing your method but it didn't work

alexnajm
18 - Pollux
18 - Pollux

Pease show what you tried then, because it worked on my side!

srk0609
8 - Asteroid

As you can see in the image I used trim function but the "," at beginning and end are still there

alexnajm
18 - Pollux
18 - Pollux

It’s because you have leading spaces, so the comma is not the first character you need to trim

 

also, if there are spaces in between each of those commas, then you will need to clear those out  A replace function to replace those instances of comma space with just a comma should do well

srk0609
8 - Asteroid

If you already did the transformation on the workflow I shared can you share the updated workflow? that would be much easier to follow. Thank you

alexnajm
18 - Pollux
18 - Pollux

I was prompting you to try it yourself based on the information given - but personally I think your Formula is messing you up here. I would look at Transposing / Crosstabbing for a more dynamic concatenation - you can take it from here!

srk0609
8 - Asteroid

Thank you for your help. I was able to achieve the desired result using your workflow. Thank you

Labels
Top Solution Authors