Oz du Soleil shows one of the most powerful features in Get & Transform in Excel 2016. How do you "unwind" data that looks like a PivotTable, and get it back to being just rows and columns? In native Excel, this is a complex and messy task. In Get & Trans
- This is exciting. Unpivot. This type of thing was painful to do in Excel. This is beautiful. Here, let's jump in. Alright. This feature, Unpivot, allows us to create what's called, a flat file, which is a conversion of a report into raw rows and columns. Here, this report was created for somebody who wants to know, okay, what were the sales of pants for the Northeast in February? Easy.
But, in the real world, we might have several questions we want to answer from this data, and it's all here, we just can't get at it. What about the overall sales of clothing versus electronics? What are the top three items in sales regardless of the store or month? We can answer those if this was a flat file. Just raw rows and columns. And we're going to make an unpivot and get at that. Okay, cursor in the data set.
Data. From Table. Here it is. Okay, now we have to think, we would like a month column here and sales data in its own column. So, sales are our values, so what we need to unpivot are the columns January, February, and March. The Item column is already highlighted. I'm going to hold down my shift key and select the Store column to get all three of those.
Go to Transform. Unpivot. Unpivot Other Columns because I've highlighted Item through Store, I don't want those unpivoted. So unpivot other columns. Oh, look at that. Let's close and load this to the workbook. And admire it. This really was painful in Excel. But we were able to convert this, to this, by unpivot.
So let's answer that question about overall sales, clothing versus electronics. Easy. We're going to create a pivot table, Insert. Pivot Table. New worksheet. Let's close this Queries pane. Category, put that in Rows. Values. That's it! We got it! And unpivot did that for us.
- What is Get & Transform?
- Querying data
- Working with columns
- Using formulas
- Pivoting and unpivoting data
- Grouping data
- Appending a query
- Merging/combining data with joins