Alteryx Designer Desktop Discussions

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

How to change rows to columns

RBoyd
6 - Meteoroid

I have data coming from a database that essentially has a row for each item in warehouse. If it is in multiple warehouses it has multiple rows.  I would like to transform this data into each item only having one row, but with each warehouses information changed into columns.

Item codeDCStatusCost
35561522
35562522
35563224
42251121
42252121
42253326
53321220
53322120
53323412

Above is  sample of what the pull from the database looks like.  I have 3 separate warehouses (DC) and a status and cost associated with each. Below is how i would like the data to look.

 

Item codeDC 1 - StatusDC 2- StatusDC 3 - StatusDC 1 - CostDC 2 - CostDC 3 - Cost
3556552222224
4225113212126
5332214202012
2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @RBoyd 

 

You can use the transformation tools to do this:

  1. Transpose Cost & Status
  2. Generate the header by concatenating DC & Name (Status or Cost)
  3. Crosstab the data back
  4. Rename the fields (crosstab adds underscores in place of spaces and special characters).

 

Luke_C_0-1659362504092.png

 

 

messi007
15 - Aurora
15 - Aurora

@RBoyd,

 

Please see below :

 

messi007_0-1659363076396.png

 

Regards,

Labels
Top Solution Authors