Merging columns with one column under the other
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I am very new to alteryx and am struggling with the below.
I have the following
col A col B col C
a x1 y1
b x2 y2
and want the following
col A col D
a x1
a x2
b y1
b y2.
i.e. I want to merge the two columns, but still have the data separated with the data in col c to be underneath the data in col b.
Please could I get some help.
Thanks
Solved! Go to Solution.
- Labels:
- Transformation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @mlp
Try using the transpose tool. It makes your data tall when your current data is wide.
Let me know if you don't come right.
Cheers
Kat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @mlp
While I would normally use the Transpose tool for something like this, I'm not sure that you're guaranteed to keep column C after column B as you are wanting.
As an alternative, I would suggest using two Select tools from your Input. One will keep Col A and Col B and the other one will keep Col A and Col C. Then just use a Union tool and choose Auto Config by Position and set the output order. See the sample workflow attached.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
Thanks so much for your reply.
Is it possible to do this union so that instead of keeping two columns after, merging them into one column?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@mlp Could you provide an example of what you mean? The workflow attached previously merges your Col B (2 rows) and Col C (2 rows) into one column (4 rows). Are you also wanting to merge with col A?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
sorry I mean exactly what you had done in the workflow earlier, except this hasn't happened on my workflow as I still have separate columns. in the top select I have ticked col a and col b, in the bottom select I have ticked col a and col c, and then in the union I have done what you have said. except I still have col a b and c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@mlp Double check that you have selected "Auto Config by Position" at the top of the configuration of your Union tool. Then, to ensure you get them in the correct order, set the output order depending on the order you connected the tools (i.e. which stream is #1 and which is #2). See the pink circles below.
