Welcome to Excel Magic Trick number 1158. If you want to download this workbook or this Access file, click on the link below the video. In this video, we want to see an awesome Excel 2013 trick. If you need to import more than 1 million rows (Control + Down Arrow), or you have more data than there are rows in Excel, we can import it even if we don't have Power Pivot. Now, we have to have Excel 2013 if our goal is to make a PivotTable, and we're not required to group by dates. We can simply import it from our normal methods, tell it to go to the Data Model, which is automatically in any Excel 2013 workbook, and then we'll access it through our normal Insert PivotTable dialogue box.
Now let's just quickly look at Access. We have 1.3 million records, and we can't dump that as a table in Excel. This trick will also work from a text file or other data input. So I'm going to go to Data, Get External Data. Ours happens to be in Access, so I'll say From Access, navigate to wherever the file is, double-click, I'm going to select the correct table, and click OK. Here's the cool thing: check this out. We have only created a connection and added this to the Data Model. Remember, the Data Model is built into any Excel 2013 file. It's got the columnar database, which not only can import huge amounts of data but also compresses it and makes the file size much smaller. That Access file is 84 megabytes. All right, I'm going to click OK. Oh, wait a second, what happened? I didn't see it anywhere. I'm not going to be able to see the data, but no problem, I can still go to Insert PivotTable and access it. I'm going to use the keyboard, Alt, N, V, and check this out: it's "Use an external data source." I'm going to click on that dialogue button, choose a connection, the Tables tab, and there it is: Tables in Workbook Data Model, one table. I'm going to click Open, and there it is. So now we can simply put it on an existing sheet at A7, click OK, and there's our normal PivotTable Field List. I uncheck to see all the fields. Now you can tell it's from the Data Model because it's got that dark line on top.
One thing is, as we mentioned, you can't take a date. If I come over here and try to right-click, there's no Group there, so you're not going to be able to do this with grouping dates. Drag it off. But our goal is to have Store ID. Actually, I'm going to click in here and zoom down a little bit. Sales: right-click, Number Formatting, something like Currency with no decimals. I want to show the actual field name, so I go up to Design, Report Layout, in either Outline or Tabular. I'm going to do Outline. I don't need this field list anymore. I'd like to go up and add some slicers: Analyze, Insert Slicer. I want City. Click OK. There's our awesome PivotTable and slicer. I'm going to click Portland. You've got to be kidding me. So I have created a PivotTable, a nice little report, easy to slice and dice. There are millions of rows of data not sitting in the Excel worksheet. I don't have Power Pivot. It's just sitting in the Data Model. As long as you don't need to look at the table and you just want a PivotTable, that's an amazing trick.
Now let's go look at the file size. There's the original database, Access, 84 megabytes. Look at that: the columnar database, our file, is 22 megabytes. It's still a huge file, but it certainly is a huge file size reduction. Hey, you need to get more than a million rows of data into a PivotTable and you're not grouping dates: use Get External Data, send it to the Data Model, and then get your PivotTable to connect to an external source. All right, we'll see you next trick.
