Alteryx Designer Desktop Discussions

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

Concatenate column values using commas excluding black

KketanPaliwal30
5 - Atom

Hi,

 

 C1C2C3C4
 B C

I need the below output from the above table. 

 

C1C2C3C4Output
 B CB,C

 

Note: If C1 has value "a" then the output should be "abc"

3 REPLIES 3
JagdeeshN
12 - Quasar
12 - Quasar

Hi @KketanPaliwal30 ,

 

If the number of columns is constant, i.e they remain C1, C2, C3 and C4 you can just use a formula tool:-

 

[Output]=[C1]+','+[C2]+','+[C3]+','+[C4]

 

Hope this helps.

 

 

Best,

Jagdeesh

JagdeeshN
12 - Quasar
12 - Quasar

@KketanPaliwal30 ,

 

I just realized the above formula would add ',' to the string even if it is null.

 

Please find attached an alternative solution that takes care of that.

 

Best,

Jagdeesh

Luke_C
17 - Castor
17 - Castor

Hi @KketanPaliwal30 

 

Here's a solution that will work for any number of columns:

 

  1. Add record ID for tracking
  2. Transpose data
  3. Filter out empty cells
  4. Concatenate remaining
  5. Join back

 

Luke_C_1-1650548538689.png

 

Labels
Top Solution Authors