Sunteți pe pagina 1din 3

c 



à 
      
? ? 

  
 
       
  ?  
|
|||
| | || | 
In this lesson, you will use the Table Import Wizard to connect to a database, select the data to
load, and import that data into your PowerPivot workbook.

PowerPivot can import data from a variety of relational sources: Access, Oracle, Sybase,
Informix, DB2, Teradata, and more. The process for importing data from each of these relational
sources is very similar to what is described below.

Additionally, data can be loaded using a custom query or stored procedure. You will do this in
the next lesson.

Keep in mind that in order to use this data in your analysis, you must create relationships
between the data from the relational database and the other data in your PowerPivot workbook.
Instructions for creating relationships are provided in a later lesson. For more information,
see Create Relationships between Tables (Tutorial).

  


This topic is part of a PowerPivot for Excel tutorial, which should be completed in order. For
information about prerequisites and the first step in the tutorial, see PowerPivot for Excel
Tutorial Introduction.

? ? 

  


1.| ºavigate to the location on your computer where you downloaded the samples and
double-click Stores. You will use the stores data in a later lesson.

2.| In the Excel window, on the ower ot tab, click ower ot W ow.

3.| In the PowerPivot window, on the ome tab, click From Database and select From Access.
This launches the Table Import Wizard which guides you through setting up a
connection to a data source.

4.| In the Fr e coect o ame field, type CotosoDB from Access.

5.| In the Database ame field, click Browse. ºavigate to the location where you downloaded
the sample files, select CotosoSaes, and click Ope.

6.| Click ºext and verify that Seect from a  st of tabe s a  ews to choose the ata to
mport is selected.

7.| You want to select from a list of tables and views, so click ºext to display a list of all the
source tables within the database.

8.| Select the check box for the following tables: DimChannel, DimDate, DimProduct,
DimProductSubcategory, and FactSales.

ºow that you have connected to the database and selected the tables to import, go to the next
section headed Filter the Table Data prior to Importing.

       


The FactSales and DimProduct tables that you are importing from the Access database contain a
subset of the data from the original SQL Server Contoso database: sales and products from two
categories (games and home appliances) are not included. You will apply a filter to one of the
other tables before importing it, so that you eliminate the same categories. You will also filter
out some of the columns from the DimProduct table.
       

1.| Select the row for the D mroct table and click re ew & F ter.

2.| The re ew Seecte Tabe window opens with all the columns in the DimProduct table
displayed.

3.| Clear the checkboxes at the top of the columns for all the columns
from CassID through StockTpeºame (a total of 15 columns) and then click OK.

4.| ºotice that the words App e f ters are now displayed in the F ter Deta s column in
the D mroct row; if you click on that link you¶ll see a textual description of the filters
that you just applied.

5.| ºow select the row for D mroctSbcategor and click re ew & F ter.

6.| Since you¶re interested in only some of the products, you will apply a filter so that you
import only the data for these categories.

At the top of the roctCategorKe column, click the arrow and deselect  and .
Categories 7 and 8 include games and home appliances, and you don't want to include
those in your analysis.

7.| At the top of the roctSbcategorDescr pt o column, clear the checkbox. Since the
descriptions are almost identical to the names, there is no need to import both
columns, and eliminating unnecessary columns will make your workbook smaller.
Click OK.

  ?  


Finally, import the selected data. The wizard imports the table relationships along with the table
data. For more information about relationships, see Relationships Between Tables.

  ? 

1.| Review your selections. If everything looks OK, click F  sh.

While importing the data, the wizard displays how many rows have been fetched. When
all the data has been imported, a message indicating success is displayed. ºotice that
you imported more than 2 million rows from the FactSaes table alone.

2.| Click Cose.

The wizard closes and the PowerPivot window is visible. Each table has been added as a
new tab in the PowerPivot window. If the data changes at the source, you can keep the
data imported into the PowerPivot window up-to-date by using data refresh. For more
information, see Different Ways to Update Data in PowerPivot.


S-ar putea să vă placă și