0% found this document useful (0 votes)
16 views

Lab 2

Uploaded by

yajairaaragon075
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Lab 2

Uploaded by

yajairaaragon075
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CHAPTER 2 IMPORTING DATA INTO POWER PIVOT

Figure 2-30. Updating the query in Query Editor mode

Now that you have seen how to import the data from various data sources into the Power Pivot data model, it is
time to get some hands-on experience importing the data.

HANDS-ON LAB—LOADING DATA INTO POWER PIVOT

In the following lab you will


Import data from an Access database.
Import data from a text file.
1. Open Excel 2013 and create a new file called LabChapter2.xlsx
2. On the Power Pivot tab, click on the Manage Data Model button (see Figure 2-31).
This launches the Power Pivot Model Designer window.

45
CHAPTER 2 IMPORTING DATA INTO POWER PIVOT

Figure 2-31. Opening the Model Designer window

3. On the Home tab in the Get External Data grouping, click on the From Database drop-down
(see Figure 2-32). In the drop-down select From Access. This launches the Table
Import Wizard.

Figure 2-32. Launching the Table Import Wizard

4. Browse for the Northwind.acdb database file in the Lab Starters folder and test the
connection. Use a friendly connection name of Access Northwind. You do not need a user
name and password for this database (see Figure 2-33). Click Test Connection to advance to
the next window.

Figure 2-33. Connecting to an Access database

46
CHAPTER 2 IMPORTING DATA INTO POWER PIVOT

5. You have two options for importing the data: You can select from a list of tables and views or
chose to write a query to select the data. Select from a list of tables and views.
6. In the Select Tables And Views window, select Customers and click on the row to highlight it.
At the bottom of the window, select the Preview & Filter button to preview and filter the data
(see Figure 2-34).

Figure 2-34. Selecting tables to import

7. In the Customers table, choose the following fields: ID, Company, Last Name, First Name,
City, State/Province, and Country/Region. Uncheck the rest of the fields (see Figure 2-35).
Checking the upper left check box will select or deselect all the columns.

47
CHAPTER 2 IMPORTING DATA INTO POWER PIVOT

Figure 2-35. Filtering table columns

8. From the Employees table select the following: ID, Last Name, First Name, and Job Title.
9. From the Orders table select these: Order ID, Employee ID, Customer ID, Order Date, Shipped Date,
Shipper ID, Payment Type, and Paid Date. On the Status ID column, click the drop-down to filter the
data. Uncheck status 0 and status 2. Status 3 represents a status of closed (see Figure 2-36).

Figure 2-36. Filtering table rows

48
CHAPTER 2 IMPORTING DATA INTO POWER PIVOT

10. When you are done selecting the tables, click the Finish button to import the data. After importing,
close the wizard. You should see each table as a tab in the Data View window (see Figure 2-37).

Figure 2-37. Tables in the Data View window

11. You are now going to select the order details using a query. In the Power Pivot Model
Designer select the Home Tab. In the Home tab select the Existing Connections button. In the
connections window select the Access Northwind connection and click Open.
12. This time, select Write A Query That Will Specify The Data To Import.
13. On the Specify A Query window, name the query OrderDetails and select the Design button
to launch the Query Designer. (You could also write the query without the designer.) In the
Query Designer, select Import and select the OrderDetailQuery.txt in the Lab Starters
folder. Test the query by clicking the red exclamation (!) mark (see Figure 2-38). After testing
the query, click the OK button.

Figure 2-38. Using a query to get data


49
CHAPTER 2 IMPORTING DATA INTO POWER PIVOT

14. In the Table Import wizard, click the Finish button to import the data. After importing, close
the wizard. You should see that an OrderDetail table tab has been added.
15. The final table you are going to import is contained in a tab-delimited text file. On the Home
tab in the Get External Data section, click the From Other Sources button. In the data sources
list select Text File and click Next.
16. In the connection information change the connection name to Product. In the File Path
browse to the ProductList.txt file in the LabStarters folder. Select a tab column separator
and check the Use First Row As Column Headers box. Click the Finish button to import the
data (see Figure 2-39).

Figure 2-39. Importing data from a text file

17. After importing, close the wizard and you should see that a Product table tab has been added.
18. When you are finished save the file and close Excel.

50

You might also like