community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Columns to Text

Hello community,

 

Maybe this is very simple, but somehow i cannot seem to find the solution: how can i convert multiple (unknown) columns to text within an workflow?

So basically i want to do the reverse of the "Text To Columns" tool in alteryx.

 

This could easily be done with the formula tool by just adding the fields together (tostring(field1)+tostring(field2).. or something). The problem is I have unkown (amount of) columns that i would like to merge into one column, so i cannot define them beforehand.

 

 

Input 1:

 

Datequerymetric 1metric 2
2018-01-01test13

 

Input 2:

Datequeryextra-dimensionmetric1metric2
2018-01-01testA1020

 

Giving this for input 1:

Datequerymetric 1metric 2merge
2018-01-01test132018-01-01,test,1,3

 

And this for input 2:

Datequeryextra-dimensionmetric1metric2merge
2018-01-01testA10202018-01-01,test,A,10,20

 

 

I anyone can send me into the right direction that would be awesome!

 

Best regards,

Matthieu

Highlighted
Alteryx Certified Partner

Hi Matthieu,

 

a solution could be to add use the Record ID tool to add an ID to each record, the use the Transpose tool to turn columns to rows,
use a Formula tool to convert the values to Strings, a Summarize tool to Concatenate and turn the rows back to columns using
the Cross Tab tool. Sounds a bit complicated, but should be easy to create.

 

Best regards

 

Roland

Probably the easiest approach is:

2019-01-17_10-45-27.jpg

- Add a record id

- Transpose the data with Record ID as key field

- Summarise to concatenate the values

- Join by RecordID

 

Sample attached

Pulsar

Here's my suggestion

 

merge.png

Quick replies! Working great. Indeed i was just trying something with the record tool and transpose tool. 

 

 

Labels