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

Move rows to columns

BautistaC888
8 - Asteroid

Hello,

I'm trying to move the rows with the same ID to columns. The output must have 1 row per ID.
I leave an example workflow.

Thank you.

3 REPLIES 3
Jean-Balteryx
16 - Nebula
16 - Nebula

Hi @BautistaC888 ,

 

I've tried to understand what you need but I need more context from you. What are you trying to achieve ?

atcodedog05
22 - Nova
22 - Nova

Hi @BautistaC888 

 

Here is how you can do it.

 

Workflow:

atcodedog05_0-1627306790875.png

 

1. Using transpose to convert columns to rows.

2. Using multi-row formula tool to get repeated occurrence of the column for each ID.

3. Using formula for adding "2","3"...n suffix to the column name.

4. Using crosstab tool to convert it to table.

 

Hope this helps : )

 

Luke_C
17 - Castor
17 - Castor

Hi @BautistaC888 

 

Here's an example of how you'd do this:

 

  1. Tile tool assigns a second ID to each ID (i.e. 12 has 3 records, so it assigns 1 2 and 3)
  2. Transpose by main ID and tile ID
  3. Rename columns to have 2 or 3 (or more in the future)
  4. Crosstab data back

You may want to rearrange the columns, but left it as is to demonstrate that it is working

 

Luke_C_0-1627307365394.png

 

 

Labels
Top Solution Authors