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

Alteryx Designer Desktop Discussions

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

Columns to Text

matthieusparkles
7 - Meteor

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

4 REPLIES 4
RolandSchubert
16 - Nebula
16 - Nebula

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

jdunkerley79
ACE Emeritus
ACE Emeritus

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

DavidP
17 - Castor
17 - Castor

Here's my suggestion

 

merge.png

matthieusparkles
7 - Meteor

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

 

 

Labels
Top Solution Authors