Search code examples
mysqlexcelselectpivot-tableunpivot

Excel 2010 Unpivot Data or Utilize MySQL for Unpivot


I've got a lot of data in an Excel sheet that I need reformatted. I am trying to achieve this by using Pivot Table but I'm not sure it is possible.

Here is current data set (SKU is unique currently): Current Excel Sheet

I need it to look more like this (where SKU is NOT unique): New Excel Sheet Needed

I'm willing to throw my current sheet into a MySQL database and query it if I can figure out a good query to utilize as well.

Any ideas on where to go from here would be appreciated.


Solution

  • It looks like you're wanting to unpivot your data (i.e. turn it from a crosstab into a flat file), although some of your desired output looks weird. Look at my answer to this question: convert cross table to list to make pivot table