Creating a pivot table

Exclusive offer: get 50% off this eBook here
Instant Creating Data Models with PowerPivot How-to [Instant]

Instant Creating Data Models with PowerPivot How-to [Instant] — Save 50%

Build better business intelligence with this practical guide to creating Excel data models with PowerPivot with this book and ebook

$12.99    $6.50
by Leo Taehyung Lee | September 2013 | Enterprise Articles Microsoft

In this article by Leo Taehyung Lee, the author of Instant Creating Data Models with PowerPivot How-to, we will learn to use the raw data to make some pivot tables that can help us make smart business decisions!

(For more resources related to this topic, see here.)

A pivot table is the core business intelligence tool that helps to turn meaningless data from various sources to a meaningful result. By using different ways of presenting data, we are able to identify relations between seemingly separate data and reach conclusions to help us identify our strengths and areas of improvement.

Getting ready

Prepare the two files entitled DatabaseData_v2.xlsx and GDPData_v2.xlsx.We will be using these results along with other data sources to create a meaningful PowerPivot table that will be used for intelligent business analysis.

How to do it...

For each of the two files, we will build upon the file and add a pivot table to it, gaining exposure using the data we are already familiar with.

The following are the steps to create a pivot table with the DatabaseData_v2.xlsx file, which results in the creation of a DatabaseData_v3.xlsx file:

  1. Open the PowerPivot window of the DatabaseData_v2.xlsx file with its 13 tables.
  2. Click on the PivotTable button near the middle of the top row and save as New Worksheet.
  3. Select the checkboxes as shown in the following screenshot:
    • Select CountryRegion | Name and move it under Row Labels‰
    • Select Address | City and move it under Row Labels
    • Select Address | AddressLine1 as Count of AddressLine1 and move it under Values
  4. Now, this shows the number of clients per city and per country. However, it is very difficult to navigate, as each country name has to be collapsed in order to see the next country.
  5. Let us move the CountryRegion | Name column to Slicers Vertical. Now, the PowerPivot Field List dashboard should appear as shown in the following screenshot:

  6. Now, the pivot table should display simple results: the number of clients in a region, filterable by the country using slicers.
  7. Let us apply some formatting to allow for a better understanding of the data.
  8. Right-click on Name under the Slicers Vertical area of the PowerPivot Field List dashboard. Select Field Settings, then change the name to Country Name. We now see that the title of the slicer has changed from Name to Country Name, allowing anyone who views this data to understand better what the data represents.
  9. Similarly, right-click on Count of AddressLine1 under Values, select Edit Measure, and then change its name to Number of Clients. Also change the data title City under the Row Labels area to City Name. The result should appear as shown in the following screenshot:

  10. Let's see our results change as we click on different country names. We can filter for multiple countries by holding the Ctrl key while clicking, and can remove all filters by clicking the small button on the top-right of slicers. This is definitely easier to navigate through and to understand compared to what we did at first without using slicers, which is how it would appear in Excel 2010 without PowerPivot.
  11. However, this table is still too big. Clicking on Canada gives too many cities whose names many of us have not heard about before. Let us break the data further down by including states/provinces.
  12. Select StateProvince | Name and move it under Slicers Horizontal and change its title to State Name. It is a good thing that we are renaming these as we go along. Otherwise, there would have been two datasets called Name, and anyone would be confused as we moved along.
  13. Now, we should see the state names filter on the top, the country name filter on the left, and a list of cities with the number of clients in the middle part. This, however, is kind of awkward. Let us rearrange the filters by having the largest filter (country) at the top and the sub-filter. (state) on the left-hand side This can be done simply by dragging the Country Name dataset to Slicers Horizontal and State Name to Slicers Vertical. After moving the slicers around a bit, the result should appear as shown in the following screenshot:

  14. Again, play with the results and try to understand the features: try filtering by a country—and by a state/province—now there are limited numbers of cities shown for each country and each state/province, making it easier to see the list of cities.
  15. However, for countries such as the United States, there are just too many states. Let us change the formatting of the vertical filter to display three states per line, so it is easier to find the state we are looking for. This can be done by right-clicking on the vertical filter, selecting Size and Properties| Position and Layout, and then by changing the Number of Columns value.
  16. Repeat the same step for Country Name to display six columns and then change the sizes of the filters to look more selectable. Change the name of the sheet as PivotTable and then save the file as DatabaseData_v3.xlsx.

The following are the steps to create a pivot table with the GDPData_v2.xlsx file, which results in the creation of a GDPData_v3.xlsx file:

  1. Open the PowerPivot window of the GDPData_v2.xlsx file with its two tables.
  2. Click on the PivotTable button near the middle of the top row and save as New Worksheet.
  3. Move the dataset from the year 2000 to the year 2010 to the Value field, and move Country Name in the Row Labels field, and Country Name again into the Slicers Horizontal field. In the slicer, select five countries: Canada, China, Korea, Japan, and United States as shown in the following screenshot:

  4. Select all fields and reduce the number of its decimal places. We can now clearly see that GDP in China has tripled over the decade, and that only China and Korea saw an increase in GDP from 2008 to 2009 while the GDP of other nations dropped due to the 2008 financial crisis.
  5. Knowing the relevant background information of world finance events, we can make intelligent analysis such as which markets to invest in if we are worried about another financial crisis taking place.
  6. As the data get larger in size, looking at the GDP number becomes increasingly difficult. In such cases, we can switch the type of data displayed by using available buttons in the PivotTable Tools | Options menu, the Show Value As button. Play around with it and see how it works: % of Column Total shows each GDP as a percentage of the year, while % Different From allows the user to set one value as the standard and compare the rest to it, and the Rank Largest to Smallest option simply shows the ranking based on which country earns the most GDP.
  7. Change the name of the sheet as PivotTable and then save the file as GDPData_v3.xlsx.

How it works...

We looked at two different files and focused on two different fields. The first file was more qualitative and showed the relationship between regions and number of clients, using various features of pivot tables such as slicers. We also looked at how to format various aspects of a pivot table for easier processing and for a better understanding of the represented data.

Slicers embedded in the pivot table are a unique and very powerful feature of PowerPivot that allow us to sort through data simply by clicking the different criteria. The increasing numbers of slicers help to customize the data further, enabling the user to create all sorts of data imaginable. There are no differences in horizontal and vertical slicers aside from the fact that they are at different locations.

From the second file, we focused more on the quantitative data and different ways of representing the data. By using slicers to limit the number of countries, we were able to focus more on the data presented, and manage to represent the GDP in various formats such as percentages and ranks, and were able to compare the difference between the numbers by selecting one as a standard.

A similar method of representing data in a different format could be applied to the first file to show the percentage of clients per nation, and so on.

There's more...

We covered the very basic setup of creating a pivot table. We can also analyze creating relationships between data and creating custom fields, so that better results are created. So don't worry about why the pivot table looks so small!

For those who do not like working with a pivot table, there is also a feature that will convert all cells into Excel formula. Under the PowerPivot Tools | OLAP Tools option, the Convert to Formula button does exactly that. However, be warned that it cannot be undone as the changes are permanent.

Summary

In this article, we learned how to use the raw data to make some pivot tables that can help us make smart business decisions!

Resources for Article:


Further resources on this subject:


Instant Creating Data Models with PowerPivot How-to [Instant] Build better business intelligence with this practical guide to creating Excel data models with PowerPivot with this book and ebook
Published: April 2013
eBook Price: $12.99
See more
Select your format and quantity:

About the Author :


Leo Taehyung Lee

Leo Taehyung Lee is an outgoing individual with a diverse background and experiences. His studies in engineering along with the pursuit of a career in finance helped him work in various positions across diverse fields from R&D to patents as well as financial risk management. He has over 3 years of extensive experience in Excel, VBA, and is a Microsoft Certified Excel Expert in Excel 2010.

Books From Packt


 Building Dashboards with Microsoft Dynamics GP 2013 and Excel 2013
Building Dashboards with Microsoft Dynamics GP 2013 and Excel 2013

Excel Programming with VBA Starter [Instant]
Excel Programming with VBA Starter [Instant]

Excel 2010 Financials Cookbook
Excel 2010 Financials Cookbook

Microsoft Dynamics CRM 2011: Dashboards Cookbook
Microsoft Dynamics CRM 2011: Dashboards Cookbook

 Microsoft Dynamics CRM 2011 Scripting Cookbook
Microsoft Dynamics CRM 2011 Scripting Cookbook

 Business Intelligence Cookbook: A Project Lifecycle Approach Using Oracle Technology
Business Intelligence Cookbook: A Project Lifecycle Approach Using Oracle Technology

Oracle Business Intelligence : The Condensed Guide to Analysis and Reporting
Oracle Business Intelligence : The Condensed Guide to Analysis and Reporting

Microsoft Dynamics CRM 2011 Application Design
Microsoft Dynamics CRM 2011 Application Design


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software