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:
Date | query | metric 1 | metric 2 |
2018-01-01 | test | 1 | 3 |
Input 2:
Date | query | extra-dimension | metric1 | metric2 |
2018-01-01 | test | A | 10 | 20 |
Giving this for input 1:
Date | query | metric 1 | metric 2 | merge |
2018-01-01 | test | 1 | 3 | 2018-01-01,test,1,3 |
And this for input 2:
Date | query | extra-dimension | metric1 | metric2 | merge |
2018-01-01 | test | A | 10 | 20 | 2018-01-01,test,A,10,20 |
I anyone can send me into the right direction that would be awesome!
Best regards,
Matthieu
Solved! Go to Solution.
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
Quick replies! Working great. Indeed i was just trying something with the record tool and transpose tool.