PC Review


Reply
Thread Tools Rate Thread

Compare 2 Pivot Tables

 
 
Kevin Labore
Guest
Posts: n/a
 
      16th Mar 2007
Hello

I am wondering if there is a easy way to compare 2 pivot tables.
There have been many times where there is not a way to show a comparison of
2 sets of data in one pivot table.
What I have done in the past for scenario is to have a workbook that has 2
worksheets containing the 2 pivot tables.
I then have a 3rd worksheet that compares the data in the 2 pivot tables
using GETPIVOTDATA.
This work fine in most cases however setting up the 3rd sheet can take some
time.

One example of where I might want to compare 2 pivot tables: I have a Pivot
Table that shows the Score Test results of an assessment test By School,
Grade, Subject, Year. I want to show a view of how a particular school did
in comparison to ALL schools. While you can easily compare 2 Schools in a
pivot table there is not a way to create a view to compare ONE school to ALL
schools with the data I am comparing. As I mentioned having a separate
worksheet reference and compare the 2 pivot tables manually was the way to
accomplish this. Normally the Pivot tables have the same structure and the
page Field would be SchoolA on one pivot table and "ALL" for the 2nd pivot
table.

I have tried searching for info on this but haven't come across of any
explanation/examples of comparing 2 pivot tables(With a 3rd PivotTable)

Thanks in advance for any help

Kevin



 
Reply With Quote
 
 
 
 
Roger Govier
Guest
Posts: n/a
 
      17th Mar 2007
Hi Kevin

The following seemed to work for me
I set up a very simple 2 column table (the number of columns does not
matter)
Column A was headed School, Column B was headed Result
Random Data was entered with a letters for school and some figures for
result.
I then extracted a copy of the rows for School A to Sheet2.

When setting up the PT, I used >
Multiple Consolidation Ranges>Next>Create a Single Page field for
me>Next>Range>select the whole range from Sheet1>Add>Select smaller
range from Sheeet2>Add>Next>New worksheet>Finish

Now, for layout (it all seems counter intuitive, but it works)
Drag Row item to Page area
Drag Page Item to Column area
Drag Column item to Row Area
Drag Value item to Data Area and set type to Average or Sum or whatever
you want.

In the Column Area, Item 1 will be the set of Data for All schools
Item 2 will be the set of Data for school A appearing alongside it

Now from the PT toolbar you need to select Table Options and turn off
Grand Total for Rows and Gran Total for columns as they will be
incorrect as Scholl A's values will be double counted.

With all your columns of "results" appearing down the rows, you will
have you comparison of the Individual school that has been extracted to
sheet 2, with the overall total.
The Row item, which you have dragged to Page area would be left at All,
to pick up all schools. If you did select another school from the Page
dropdown, then just the results for that school would show as a single
column, apart from School A (in this case) where there would be 2
identical columns of data comparing itself with itself.

You could easily automate the extraction of the desired school to
Sheet2, using Advanced Filter.
For more help on this, take a look at Debra Dalgleish's site
http://www.contextures.com/xladvfilter01.html#ExtractWs

Debra also has some downloadable example files with code to automate
procedures, which you should be able to modify to suit your needs.


--
Regards

Roger Govier


"Kevin Labore" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
>
> I am wondering if there is a easy way to compare 2 pivot tables.
> There have been many times where there is not a way to show a
> comparison of 2 sets of data in one pivot table.
> What I have done in the past for scenario is to have a workbook that
> has 2 worksheets containing the 2 pivot tables.
> I then have a 3rd worksheet that compares the data in the 2 pivot
> tables using GETPIVOTDATA.
> This work fine in most cases however setting up the 3rd sheet can take
> some time.
>
> One example of where I might want to compare 2 pivot tables: I have a
> Pivot Table that shows the Score Test results of an assessment test By
> School, Grade, Subject, Year. I want to show a view of how a
> particular school did in comparison to ALL schools. While you can
> easily compare 2 Schools in a pivot table there is not a way to create
> a view to compare ONE school to ALL schools with the data I am
> comparing. As I mentioned having a separate worksheet reference and
> compare the 2 pivot tables manually was the way to accomplish this.
> Normally the Pivot tables have the same structure and the page Field
> would be SchoolA on one pivot table and "ALL" for the 2nd pivot table.
>
> I have tried searching for info on this but haven't come across of any
> explanation/examples of comparing 2 pivot tables(With a 3rd
> PivotTable)
>
> Thanks in advance for any help
>
> Kevin
>
>
>



 
Reply With Quote
 
Kevin Labore
Guest
Posts: n/a
 
      18th Mar 2007
HI Roger

Thanks for the explanation
I figured there was simpler solution than my alternate solution which did
work, but was work to set up the 3rd sheet and do the referencing and
formatting

Kevin


"Roger Govier" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Kevin
>
> The following seemed to work for me
> I set up a very simple 2 column table (the number of columns does not
> matter)
> Column A was headed School, Column B was headed Result
> Random Data was entered with a letters for school and some figures for
> result.
> I then extracted a copy of the rows for School A to Sheet2.
>
> When setting up the PT, I used >
> Multiple Consolidation Ranges>Next>Create a Single Page field for
> me>Next>Range>select the whole range from Sheet1>Add>Select smaller range
> from Sheeet2>Add>Next>New worksheet>Finish
>
> Now, for layout (it all seems counter intuitive, but it works)
> Drag Row item to Page area
> Drag Page Item to Column area
> Drag Column item to Row Area
> Drag Value item to Data Area and set type to Average or Sum or whatever
> you want.
>
> In the Column Area, Item 1 will be the set of Data for All schools
> Item 2 will be the set of Data for school A appearing alongside it
>
> Now from the PT toolbar you need to select Table Options and turn off
> Grand Total for Rows and Gran Total for columns as they will be incorrect
> as Scholl A's values will be double counted.
>
> With all your columns of "results" appearing down the rows, you will have
> you comparison of the Individual school that has been extracted to sheet
> 2, with the overall total.
> The Row item, which you have dragged to Page area would be left at All, to
> pick up all schools. If you did select another school from the Page
> dropdown, then just the results for that school would show as a single
> column, apart from School A (in this case) where there would be 2
> identical columns of data comparing itself with itself.
>
> You could easily automate the extraction of the desired school to Sheet2,
> using Advanced Filter.
> For more help on this, take a look at Debra Dalgleish's site
> http://www.contextures.com/xladvfilter01.html#ExtractWs
>
> Debra also has some downloadable example files with code to automate
> procedures, which you should be able to modify to suit your needs.
>
>
> --
> Regards
>
> Roger Govier
>
>
> "Kevin Labore" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello
>>
>> I am wondering if there is a easy way to compare 2 pivot tables.
>> There have been many times where there is not a way to show a comparison
>> of 2 sets of data in one pivot table.
>> What I have done in the past for scenario is to have a workbook that has
>> 2 worksheets containing the 2 pivot tables.
>> I then have a 3rd worksheet that compares the data in the 2 pivot tables
>> using GETPIVOTDATA.
>> This work fine in most cases however setting up the 3rd sheet can take
>> some time.
>>
>> One example of where I might want to compare 2 pivot tables: I have a
>> Pivot Table that shows the Score Test results of an assessment test By
>> School, Grade, Subject, Year. I want to show a view of how a particular
>> school did in comparison to ALL schools. While you can easily compare 2
>> Schools in a pivot table there is not a way to create a view to compare
>> ONE school to ALL schools with the data I am comparing. As I mentioned
>> having a separate worksheet reference and compare the 2 pivot tables
>> manually was the way to accomplish this. Normally the Pivot tables have
>> the same structure and the page Field would be SchoolA on one pivot table
>> and "ALL" for the 2nd pivot table.
>>
>> I have tried searching for info on this but haven't come across of any
>> explanation/examples of comparing 2 pivot tables(With a 3rd PivotTable)
>>
>> Thanks in advance for any help
>>
>> Kevin
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Building pivot tables in Excel 2007 based on existing pivot tables? jj.jigga.johns@gmail.com Microsoft Excel Misc 4 26th Dec 2007 08:05 PM
Compare 2 pivot tables and report differences E Microsoft Excel Worksheet Functions 2 1st Jan 2007 07:51 PM
How do I compare data in two pivot tables =?Utf-8?B?YnJhbmR5c29tbWVyZmVsQGRpc2N1c3Npb25zLm1p Microsoft Excel Misc 1 12th Jun 2006 09:33 PM
How do I compare output data from 2 pivot tables in a graph forma. =?Utf-8?B?RG9vYmk=?= Microsoft Excel Charting 2 6th Feb 2005 11:36 PM
Pivot tables-controlling user interaction with pivot tables Sindhura Microsoft Excel Programming 0 27th Aug 2003 02:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:00 AM.