Alteryx Designer Desktop Discussions

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

Inserting comma between strings within a column

mzsweetumz
8 - Asteroid

Hi I would like to insert a comma between the fast food restaurants show in attachment.

 

Any help is appreciated.

 

sample1.PNG

7 REPLIES 7
rzdodson
12 - Quasar

@mzsweetumz you can use the Concatenate function within the Summarize tool to perform this action.

 

1. Insert a Summarize tool immediately following your Fast Food input
2. In the Summarize tool's configuration settings, you'll go to Add > String > Concatenate. The comma separator will be the default option.

mzsweetumz
8 - Asteroid

hmm this didn't work

rzdodson
12 - Quasar

@mzsweetumz are you needing the list of restaurants in two columns, with the first column being every restaurant, and the concatenation in occurring in the last column for the last row; or, are you just needing the concatenated list of restaurants within your data set?

 

If it is the first one, I'll direct you to the first container in the attached.

Solution 1.png

 

If it is the latter, go with the second.

Solution 2.png

mzsweetumz
8 - Asteroid

@rzdodson Thank you, but the issue is the restaurant names are not in separate rows... they're already concatenated into one row separated by a space/line/enter? I am trying to separate it by comma.

rzdodson
12 - Quasar

@mzsweetumz presuming you are starting out with Column 2 as your initial input, and you are trying to get to what the output looks like in Column 1, you can insert a Text to Columns tool - it has an embedded Split to Rows function inside that will enable you to separate on delimiters. Hope this gets you closer to what you need. :)

 

Solution.png

 

DataNath
17 - Castor

Hey @mzsweetumz, if it's a linebreak you're looking to replace then you can just use the Replace() function like so:

 

7070.png

 

Replace([Fast food], '
', ', ')
HomesickSurfer
12 - Quasar

Hi @mzsweetumz 

 

Assuming your data is stacked as newlines, use formula: REGEX_REPLACE([Fast food],'\n',', ')

Labels