官术网_书友最值得收藏!

Using data feeds

Data feeds allow a tabular model to consume XML data through an HTTP service—these are called the OData and .atomsvc feeds. The feed(s) can be defined to the model through either an OData service (which also can provide data) or a data service document (the .atomsvc file) that specifies the URL to the service.

The Open Data Protocol (OData) is a standard protocol for creating and consuming data over existing technologies such as HTTP. This means that data can be imported into the model as a web service. The ability to use data which is not generated from the corporate environment extends the possible data sources that can be used for analysis. Data may be available for free or purchased from vendors (see http://datamarket.azure.com/ for both).

Getting ready

This recipe imports some data from an online database called Northwind. Northwind is a well-known sample database (actually, the data is not that important to us—only the technique used to import it is). We also examine importing data from a reporting services report (which is imported as an .atomsvc file).

How to do it…

We firstly examine how to import data using OData and then we examine how to obtain data from a reporting services report.

  1. Open a new Workbook and launch the PowerPivot window.
  2. Click on the From Data Feeds button from the Get External Data group.
  3. Name the connection NorthWind, and use the following data feed URL:

    http://services.odata.org/Northwind/Northwind.svc/.

  4. Click on Test to test the connection, and then click on the Next button.
  5. The Table Import Wizard window will open, here we can select which tables we would like to import.
  6. Note that the Select Related Tables button is inactive and cannot be used.
  7. Highlight the Products table and select the Preview & Filter button.
  8. The Wizard changes to a grid view; however, the table cannot be filtered (there are no filter dropdowns).
  9. Click on Finish to import the Products table.
  10. Open a reporting services report and select the Export to Data Feed button. This button is identified in the following screenshot:
    How to do it…

    Tip

    Unfortunately, we cannot provide specifics about the reporting services report that is required for this recipe. The configuration of reporting services and the associated creation of the report is outside the scope of this book. We do discuss the steps involved which are common to all reporting services reports.

    These steps can also be applied to SharePoint lists (which have the same export button).

  11. A warning message will prompt to save or open a file with the name of your report and an .atomsvc extension.
  12. Click on Save.
  13. Open PowerPivot and import data by clicking on the From Data Feeds button.
  14. Click on the Browse button and navigate to the file which was saved in the previous step. In this case, there is no need to provide the data feed URL.
  15. Select the file and click on the Open button.
  16. This time, the Table Import Wizard window lists report objects (Tablix's, lists and charts) as tables that can be imported to PowerPivot.
  17. Just like OData feed, there is no ability to filter the data or detect relationships between tables.

How it works…

The OData feed provides a web service which is essentially exposed to the tabular model as an XML feed, and may contain information about the data source, including tables within the source. This file can then be imported to the tabular model.

主站蜘蛛池模板: 雷波县| 济南市| 怀来县| 中牟县| 黄石市| 眉山市| 高州市| 新民市| 宁夏| 芜湖县| 临江市| 雅江县| 大同市| 汕尾市| 托里县| 临颍县| 齐齐哈尔市| 固始县| 阿荣旗| 沐川县| 巢湖市| 陈巴尔虎旗| 华亭县| 介休市| 镇平县| 上思县| 棋牌| 临桂县| 江口县| 荥阳市| 平顶山市| 雷山县| 肥乡县| 封丘县| 新和县| 乌兰察布市| 惠安县| 皋兰县| 浦东新区| 荔浦县| 远安县|