Forum Discussion

phraingck's avatar
phraingck
Copper Contributor
Mar 26, 2023

Transpose some rows to columns, then merge rows

How do I go about transforming the table on the left to the table on the right?
I have 600,000 rows to do:

 

RegistrantID

ElectionDate

 

11/8/2022

11/3/2020

11/6/2018

11/8/2016

11/4/2014

7241

11/3/2020

 

7241

7241

7241

7241

 

7241

11/6/2018

 

20917

20917

20917

20917

7241

11/8/2022

 

22268

22268

22268

22268

 

7241

11/8/2016

 

22273

22273

22273

22273

22273

20917

11/6/2018

 

 

23654

23654

23654

23654

20917

11/8/2022

 

 

 

 

 

 

20917

11/3/2020

 

 

 

 

 

 

20917

11/8/2016

 

 

 

 

 

 

22268

11/8/2016

 

 

 

 

 

 

22268

11/8/2022

 

 

 

 

 

 

22268

11/3/2020

 

 

 

 

 

 

22268

11/6/2018

 

 

 

 

 

 

22273

11/4/2014

 

 

 

 

 

 

22273

11/8/2016

 

 

 

 

 

 

22273

11/8/2022

 

 

 

 

 

 

22273

11/3/2020

 

 

 

 

 

 

22273

11/6/2018

 

 

 

 

 

 

23654

11/3/2020

 

 

 

 

 

 

23654

11/6/2018

 

 

 

 

 

 

23654

11/4/2014

 

 

 

 

 

 

23654

11/8/2016

 

 

 

 

 

 

2 Replies

  • phraingck 

    An alternative could be Power Query. In the attached file you can add data to the blue dynamic table. Then you can click in any cell of the green table and right-click with the mouse and select refresh to update the green result table.

     

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    You can come close by creating a pivot table from the first two columns. Drag the Election date field to the column area and the RegistrantID to both the row area and the Values area.

Resources