Alteryx Designer Desktop Discussions

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

Trying to make a column as factor with muliple numbers

KaranHva
5 - Atom

Hi everyone,

 

I am trying to make a Column that contains multple numbers as factor.

For example I have 3 Column with number 1, 5 and 7. I would like to add those number into 1 Column like this: (1, 5, 7) instead of (13) which is sum of these numbers. 

Could somebody give me a formule that might fix my problem?

 

Kind regards,

 

Karan

4 REPLIES 4
AngelosPachis
16 - Nebula

Hi  @KaranHva ,

 

You can use a transpose tool to pivot the columns you want to add in one column (make sure you select all other columns as key columns in the transpose tool.

 

Then add a select tool and change the data type of the column [Value] to be a vwstring. Finally with a summarize tool, you can concatenate the values under the [value] column and use comma as a delimiter (again don't forget to group on any other dimension).

 

AngelosPachis_1-1638376265459.png

 

steven_king
6 - Meteoroid

Hello @KaranHva ,

If you are specifically looking for a formula that you can use in a formula tool, then the below should work.

ToString([Field1]) + ', ' + ToString([Field2]) + ', ' + ToString([Field3])

 

steven_king_1-1638377500861.png

 

 

KaranHva
5 - Atom

I got stuck at summarize tool. What am I doing wrong? @AngelosPachis

AngelosPachis
16 - Nebula

Hi @KaranHva ,

 

I think the issue was in the transpose tool, so the key columns are those that you don't want to pivot and the data columns are those that will get pivoted.I believe you have select them the other way around.

 

Have a look at the attached workflow and let me know if that's heading towards the right direction. The way suggested by @steven_king works perfect, but in case you want to concatenate 15 columns together that will create a huge expression which is hard to maintain.

 

Cheers,

Angelos

Labels