Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Remove extra commas from columns after using summary tool and concatenate

cowannbell
9 - Comet

This is what my output looks like the below when using the summary tool and concatenate.  I want to remove any leading or trailing commas.  How can I do that? 

 

Column 1          Column 2                Column 3

2691612,,,,          ,,,,DN               ,10101,50101,50102,

8 REPLIES 8
SGolnik
11 - Bolide
11 - Bolide

The regex tool is going to be your best bet since you can use wildcards to say 0 or more of the comma on either side of the data. Take a look at www.regex101.com or www.regexone.com if you aren't familiar with regex.

Swathi
9 - Comet

Hi, 

You can use Data cleansing tool and select the columns you want to cleanse and click on Punctuation like in the below screenshot. Please Mark as solution if it was helpful 

Capture.PNG

rzdodson
12 - Quasar

@cowannbell here is another approach using a Multi-Field Formula tool.

 

Solution.png

Swathi
9 - Comet

I would actually go using Multi field formula tool, because imagine if you have decimals somewhere, punctuation with data cleanse would be making it worse

cowannbell
9 - Comet

Thanks but this removes all commas

cowannbell
9 - Comet

This removes all commas.  I want to keep the commas between numbers/text.

rzdodson
12 - Quasar

@cowannbell slightly different approach based on your previous post.

 

Solution 2.png

cowannbell
9 - Comet

I found the correct expression.   (^[,\s]+)|([,\s]+$)

Labels
Top Solution Authors