In my endeavor to explore Open Data Protocol – I have been writing a blog series titled Tool Spotlight. In these series I try to take a tool which supports OData and play around with the tool. Today we will be checking out one such tool. The tool is known as “PowerPivot for Excel 2010”. So rest of this post will be to know more about PowerPivot. Lets start
About PowerPivot for Excel 2010:
Here is what MSDN documentation says about PowerPivot:
PowerPivot for Excel is an add-in to Excel 2010 that is used for adding and integrating large amounts of data in Excel workbooks. The data that you add to the workbook is stored internally, as an embedded PowerPivot database inside the .xlsx file.
As the documentation says this is an Add-In to Excel. Although this add-in is intended to be used with large amounts of data, it does have a feature to play around with OData. We will see in further sections as to how to do this.
Getting PowerPivot for Excel 2010:
PowerPivot for Excel 2010 is available as a free download at the following location:
Once you install the add in Excel will now get a new Ribbon Tab by name “PowerPivot”. Here is a snap shot of excel after the add in has been installed:
If you click the “PowerPivot Window” button which is the first button on the left hand side, a new window will open up. This is the PowerPivot add in. Here is the snapshot of the same:
Working with OData:
PowerPivot allows us to work with OData feeds in two ways. They are:
OData Data Feeds – publicly available OData Feeds like NetFlix
Azure DataMarket DataSets – Azure DataMarket exposes the datasets as OData
We will see how to work with above data sets one by one.
Connecting to OData Data Feeds:
First open excel, select powerpivot tab and click on the powerpivot window button. In the powerpivot window, in “Get External Data” tab group click “From Data Feeds”.
We will be presented with “Table Import Wizard”. Provide a name in the “Friendly connection name” textbox. For my example I will be using publicly available OData feed from Netflix. Provide the URL in the “Data Feed Url” text box. The Netflix OData feed is available at http://odata.netflix.com/Catalog. Note that “/Catalog” is terms of OData protocol is known as service root document or in terms of ATOM is a ATOM service document. PowerPivot is intelligent enough to detect that and will provide the options accordingly. Here is a screen shot of Table Import Wizard:
Note the options in this window. Browse button will allow us to select a locally stored Atom Service Document (*.atomsvc) or locally stored Atom Feed (*.atom).
Test Connection button will try to connect to the data source and will let us know whether it was a success or not. The Advanced button will let us play around with advanced properties which we can set on the request.
Note that PowerPivot was able to detect that the URL provided was a service root document and it has figured out the DataSets available. Genres, Languages, People, TitleAudioFormats, TitleAwards, Titles, TitleScreenFormats are all datasets available as aprt of Netflix. Here we can select all or one of the dataset and get the data down to powerpivot. There is a Preview & Filter option available. With this we will be given a sample data from the dataset selected and we can filter the columns we need.
As you can see there is a checkbox on each column. This allows you to either bring in the column or not for visualization. When we click Finish on the Table Import Wizard the selected data set will be pulled down from the source to inside the PowerPivot.
For the example I will be working with Titles dataset and since Netflix has huge collection, I will be bringing down only 100 titles. Here is the URL I am using: http://odata.netflix.com/v2/Catalog/Titles?$top=100&$orderby=ReleaseYear desc
Here is what the data looks like after pulling it down to PowerPivot:
Connecting to Azure DataMarket Data Feeds:
About Azure Data market:
If your first question at this moment is “what is Azure Data Market”, here is the official definition:
The Windows Azure™ Marketplace is an online market buying, and selling finished Software as a Service (SaaS) applications and premium datasets. The Windows Azure Marketplace helps connect companies seeking innovative cloud based solutions with partners who have developed solutions that are ready to use.
Azure Data Market originally known as Azure Marketplace allows you to browse premium datasets which are all exposed as OData. You can browse for a dataset which is offered free of cost. Log in to data market with your live id and subscribe for a data set. Once you sign up for data market you will be getting your own Account Key. This is required to consume the data sets that you subscribe. You can browse for data sets here: https://datamarket.azure.com/browse/Data. I will be using the following data sets for this post: https://api.datamarket.azure.com/Data.ashx/StockViz/CapitalMarketAnalyticsIndia/LivePrices?$top=100
Use Power Pivot to connect to Data Feed:
In Power Pivot Window, click on the button “From Azure DataMarket”. Check the below screenshot:
You will be presented with “table Import Wizard”. You will need to have your Data Market data set feed URL handy now. Also you need to have your account key. Here is the Table Import Wizard:
This is the same Table Import Wizard we saw in the previous section. So you will find the same features here like – Advanced Properties, Browse, Test Connection. Only change is the Security Settings section where you need to provide your account key. Once you finish the import the data set will be pulled into the power pivot. Here is the screenshot:
As you can see, importing data into Power Pivot whether from a Public Feed or Azure Data Market is a seamless experience. Now lets see what we can do with the data.
After you have pulled down the data from the feed to Power Pivot, you can use Pivot Table option and create a Pivot Chart from the data you just downloaded. In this example I am using the Netflix data that we pulled in the first section. Here is how you add a Pivot Chart:
The Pivot Char will be added to your main workbook. Here is a chart I was able to design from the data we downloaded. I have plotted a graph for Average Rating Vs. Number of Movies under that rating. I have also added slicer like Rating i.e. Parental Guidance, Universal etc. and Release Year. Here is the screenshot of the pivot chart:
In this blog post we took an overview of how easy it is to use Power Pivot Add In for Excel 2010 to consume OData. We saw how Power Pivot provides us with an option to preview and filter the data before consuming it. We also saw how Power Pivot makes the experience of connecting to a public feed Vs connecting to a Data Market feed so seamless. Also if you a person who is entitled with creating meaningful charts out of the data you download, Power Pivot gives you the ability to create Pivot Charts and within no time you have a meaning to the data you downloaded. I highly recommend playing around with Power Pivot. I certainly believe OData and Power Pivot make it a deadly combination for Business Intelligence on the fly.
Hope this blog post provides you with some learning on OData and Power Pivot. Do let me know of your feedback if any.
As usual, till next time – Happy Coding. Code with Passion, Decode with Patience.