Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

How to concatenate n number of columns based on an specific name

Sshasnk
8 - Asteroid

Hi All,

 

So I have a table where I want to conatinate the column with comma seprated but the only challenge is the number of columns could increase or decrease everytime.

So for example below.

ID namesource id 1source id 2source id 3final id 1final id 2
123ABC13121
234GHD2  3 
12KLF34 43
1KNI46454
234KNR57165

 

1. I want to concatenate all the source columns in to one and same for final id column

2. The number in front of Source id and final id will always change 

3. Starting two fields should not change.

 

Output example:

ID nameSource IDFinal ID
123ABC1,3,12,1
234GHD23
12KLF3,44,3
1KNI4,6,45,4
234KNR5,7,16,5
2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@Sshasnk 
We can first remove the postfix of digits with RegEx_Replace function, the do a CrossTab.

0607-Sshasnk.png

Raj
15 - Aurora

@Sshasnk 
one way of doing this

Labels