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

Alteryx Designer Desktop Discussions

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

Concatenate columns shortcut

akasubi
8 - Asteroid

I would like to concatenate the values of my columns into a single column, but there are 17 columns in total. Is there a shortcut to do this without having to manually type out the formula for each column name?

 

Additionally, I'd like to add a space in between each column value and where there is a blank value to ignore that column.

 

Is this possible?

 

Example data below

ID    Concatenated field
1MILK   MILK
2 EGGS  EGGS
3 EGGS BREADEGGS BREAD
4MILK CEREAL MILK CEREAL
5MILKEGGS BREADMILK EGGS BREAD
2 REPLIES 2
estherb47
15 - Aurora
15 - Aurora

Hi @akasubi 

With a little transpose, formula, summarize, it's easy to work with a ton of columns!

 

First, transpose the data with the key field of ID. That makes everything vertical. Then, use a formula tool to remove all of the spaces (Replace([Value]," ",""). I find that faster than the Data Cleansing tool.

 

Finally, summarize back together. ID is the group by field, and concatenate the values, using a space as the separator.

 

EstherB47_0-1583919938643.png

 

Let me know if that helps. Cheers! Esther

TomWelgemoed
12 - Quasar

Hi,

 

Yes, Pivot the columns first and then use the Concatenate option in the Summarise tool. Workflow example attached.

 

Regards,

Tom

 

Concatenate.png

Labels