Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Merging columns with one column under the other

mlp
5 - Atom

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

6 REPLIES 6
kat
12 - Quasar

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

Kenda
16 - Nebula
16 - Nebula

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!

 

Capture.PNG

mlp
5 - Atom

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

Kenda
16 - Nebula
16 - Nebula

@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?

mlp
5 - Atom

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

Kenda
16 - Nebula
16 - Nebula

@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.

 

Capture.PNG

Labels