Welcome to MSDN Blogs Sign in | Join | Help

PivotTables V: Context menus

Today I wanted to talk about PivotTable context menus, for two reasons … first, because we have updated them to make them more useful, and second, because we have added some neat new features that are exposed primarily in context menus.  All of this is part of our work to make PivotTables easier to explore and manipulate.  Let’s take a look at some of the improvements and additions.

Sorting by items on rows or columns
Below is a screenshot of the context menu for an item on rows or columns (we have a different context menu for values which is covered below). The item used in the example is Mountain Bikes of the Product Category field.


(Click to enlarge)

We have added sorting and filtering options to the context menu to make it fast/easy to sort/filter the current selection. (I will go into more depth on sorting and filtering improvements in a later post.  Today I’ll just review the sort and filter context menu options.)

The context menu allows you to apply an ascending or descending sort based on the item names, or you can manually move items of a field to the position you want. Here is a screenshot of the sort menu in the beta version of Excel illustrating those options.


(Click to enlarge)

Filtering
Located just below the sort menu, the filter menu provides direct access to the dialogs for setting up a dynamic filter on the selected field (I’ll cover dynamic filters in a later post), and it also provides the option of defining a manual filter by just displaying the items selected, hiding all the other items of the field, or hiding the selected items.  Here is a screenshot of the filter menu … being able to hide or show only selected items is a very handy feature that we think PivotTable users will love.


(Click to enlarge)

Turning on and off subtotals
In many reports, subtotals are not needed for specific fields. This is often tied to the report layout chosen, but it can also be simply because it doesn’t really make sense to add up the numbers in a given context.  For this reason, we added the option to turn on and off the display of subtotals of the selected field to the context menu. For example, consider this PivotTable.


(Click to enlarge)

Pretend that the source data for this PivotTable does not contain sales data for all bikes and, before sending out this report, you want to remove the subtotals for Mountain Bikes and Road Bikes so that the report does not contain subtotals that can be considered incorrect since they only represent a subset of the bikes sold.  All you have to so is to right-click Mountain Bikes or Road Bikes and select the subtotal option.


(Click to enlarge)

And now the PivotTable no longer contains the subtotals for Mountain Bikes and Road Bikes.


(Click to enlarge)

Expand/Collapse
The Expand/collapse menu offers a fast way to expand multiple fields at once (this has come up in comments as well as a few emails folks have sent this week). Say you have the following PivotTable and you want to display all the available details for Canada.


(Click to enlarge)

In the context menu, all you have to do is to select the field that you want to expand to, in this example Product Name.


(Click to enlarge)

And the PivotTable now displays all the details for Canada.


(Click to enlarge)

The context menu will show you all the fields on the axis, so you can collapse or expand to any field you want.  As you can imagine, this is even more useful when there are more than the three fields of this simple example.

Sorting by values
As I mentioned, the context menu users see for values is different from the one they see for rows and columns.  Here is what the values area context menu looks like in current builds.


(Click to enlarge)

Just like in the context menu for items on rows and columns we’ve added a sort menu. However, applying a sort here will sort the items by the values in the Values area instead of by item names so, for example, you can sort products ascending by sales amount.

Expand to detail
Expand to detail allows you to query for the rows from the source data that were included for calculating the aggregated value in the selected cell.


(Click to enlarge)

Here is a screenshot of the source data rows returned in the example when performing the “expand to detail” operation. The rows are placed in a new worksheet.


(Click to enlarge)

Summarize data by …
The last context menu option I’ll cover today is the “Summarize Data By” menu, which we hope is a time saver.  Sometimes you may want to count the number of instances in the source data for certain criteria instead of simply adding the individual numeric values, or you may want to use one of the other numeric functions for aggregating the data (like Max, Min, Average etc.).  To make this very easy, the aggregation functions are now exposed in the context menu of cells in the Values area. To illustrate, here is the PivotTable I’ve been using for other examples today.


(Click to enlarge)

This PivotTable is aggregating the source data using the Sum function. Now, let’s try and change this to Count.


(Click to enlarge)

And that’s all it takes to have the PivotTable use Count instead of Sum to aggregate the source data. Here is a screen shot of the result.


(Click to enlarge)

That wraps up our quick tour – I know I didn’t cover everything, so feel free to ask questions about other items you saw you would like explained.  Next up, filtering improvements.

Published Thursday, December 15, 2005 3:01 PM by David Gainer
Filed under:

Comments

# re: PivotTables V: Context menus

Thursday, December 15, 2005 11:27 PM by Step
I have to admit, I'd always wondered what Pivot Tables were and who used them....your series has cleared up those questions, and I'm now really excited to start applying my new-found knowledge. Thanks!

# re: PivotTables V: Context menus

Friday, December 16, 2005 3:40 AM by Eli
Hi David,

Great improvements! Q concerning 'Expand to detail': is there a possibility to jump to the original data (instead of to a representation of it in a new worksheet)?

Need it when I e.g. see an error in a pivot - jump to the source, correct issues, refresh pivot - takes a lot more actions now..

# re: PivotTables V: Context menus

Friday, December 16, 2005 11:19 AM by David Gainer
Hi Eli - thanks for the feedback. What behaviour would you be looking for, exactly? Since the records for that total could be separated widely in your source data, where would you expect to be taken?

# re: PivotTables V: Context menus

Friday, December 16, 2005 1:21 PM by Greg Hingsbergen
>>I have to admit, I'd always wondered what Pivot
>>Tables were and who used them....your series
>>has cleared up those questions, and I'm now
>>really excited to start applying my new-found
>>knowledge. Thanks!

Shoot, you just made me realize that once my co-workers start figuring out Pivot Tables for themselves that they are going to think I'm less of an Excel wizard than they currently do! ;-)

# re: PivotTables V: Context menus

Friday, December 16, 2005 1:31 PM by Brad Bierman
David,

Thank you for sharing the updates. The more the better as I'm already preparing a business case document for this version. As far as Eli's post I agree it would be usefull to have that jump to an error.. since most pivottables are based on a list/database structure could you use an auto-filter to limit the visible rows shown?

I also have a seperate request for this version or next. We need some heirchacal control of worksheets. Most of my teams projects are created purely in excel and can be 40-60 MB with a similar number of worksheets. Tab colors is a nice first step, but I would love to have the ability to place worksheets in a tree structure even if it only had one level.


For example I have an existing workbook with 6 major sections. <Setup>, <Inputs>, <Data>, <Analysis>, <Query Engine>, <Programming>

Each section is comprised of many worksheets.

Right now it might look something like this with the flat structure of excel tabs
http://www.biermantek.com/share/currentXL.gif
but i wish we could make it do this:
http://www.biermantek.com/share/propXL.gif

# re: PivotTables V: Context menus

Friday, December 16, 2005 3:10 PM by Ted Schurman
David,

Will there be support for summarizing the data by "Median"?

Thanks

# re: PivotTables V: Context menus

Friday, December 16, 2005 10:54 PM by Jean Martineau
I like these context menus. Another great improvement. I would also like these improvements:

- Eli and Brad expansion to details by filtering directly on the Excel source data based on the selection in the pivot table.
- Brad idea and picture for sheet grouping
- Median, percentile summarize in Pivot Table
- Will it be possible to select more than one summarize function by holding the CTRL key and selecting the desired functions directly in the Context Menu ?

# re: PivotTables V: Context menus

Saturday, December 17, 2005 7:34 AM by Joe Dowski
Brad,

I really like your idea of tree view sheet grouping !!! I've never given that much thought as most of our spreadsheets don't have that many tabs...but occasionally we get a monster to work with and it can be tough to navigate. Another take on that thought could be to have the sheet navigation dialog (I bring it up by right clicking the arrow tabs on the bottom left) be a dockable window that would have a true tree view navigation pattern. The sheet tabs on the bottom would be hidden/visible based on the expanded or collapsed tree view in the Navigation window ?? Maybe not relevant for every user but perhaps as an addin that could be activated for those who need it ??

Joe

# Grouping tabs

Sunday, December 18, 2005 1:20 AM by SlashDotJunkie
Sweet idea, Brad! I don't have large books, but I imagine it would be useful for advanced users. Maybe for that one case Excel can borrow a page from OneNote's book of tricks :)

# re: PivotTables V: Context menus

Sunday, December 18, 2005 2:33 PM by Eli
David – expand to details again. Indeed as Brad put it: by applying an autofilter on the source data (excel data of course).

# re: PivotTables V: Context menus

Monday, December 19, 2005 1:11 AM by irshags
One aggregating option that I've always believed would be extrememly helpful for pivot tables is a 'count of distinct'. There's been countless times this would have been infintely more meaningful than 'count'.

Another great option would be to create additional columns in the pivot-table to contain analytical functions. Currnetly, to the best of my knowledge, you can only run aggregates on the contents of a single column in your data-set.

For example: Let's say I have a table containing costs and revenue for products across a number of locations.

Product Location Cost Revenue
Apples A 10 8
Apples B 20 14

Wouldn't it be nice to set-up a column entitled 'Profit', that for any grouping contains the difference between revenue and cost? If other operations were available (simple math, or more complicated user defined functions) pivot tables would become an even more robust tool.

Lastly, thanks for all the great work, and for making this forum available...

# re: PivotTables V: Context menus

Monday, December 19, 2005 8:07 AM by Tommy
irshags,
I agree with you on 'count distinct'. That should also be an option in the List feature and the Subtotal worksheet function, as well as for status bar calculation. As for your table example I think you can achieve what you want by setting up a calculated field.

Dave,
Some people have been asking for a way to hide calculated items that result in zero, without using code. Will that be possible in Excel 12?

# re: PivotTables V: Context menus

Monday, December 19, 2005 10:00 AM by Colin Banfield
<< also have a seperate request for this version or next. We need some heirchacal control of worksheets. Most of my teams projects are created purely in excel and can be 40-60 MB with a similar number of worksheets. Tab colors is a nice first step, but I would love to have the ability to place worksheets in a tree structure even if it only had one level. >>

I'm hoping that something like this makes it into the next version of Excel. I made a similar suggestion why back in September (scroll down to see comment):

http://blogs.msdn.com/excel/archive/2005/09/28/475041.aspx#comments

If the task pane object is exposed in Excel 12, it might be possible to build a navigation pane in VBA.

Colin

# re: PivotTables V: Context menus

Tuesday, December 20, 2005 8:53 PM by David Gainer
Greetings – thanks all for the feedback and comments.

Brad et al – the sheet tab idea is an interesting one … navigating around big workbooks is something I find to be an interesting design problem, and this is certainly a possible improvement.

Ted, Jean – no changes to the available summarizations. Are there others besides median, distinct count, and percentile others would like to see? Jean – no multi-select summarize this version.

Irshags – as Tommy suggests, you can add “calculated items” to PivotTables in current versions that allow you to do what you suggested … take a look and let me know if it doesn’t do what you expect.

Tommy – no changes to calculated items this version, though it is an area I want to think about in the future.

Colin – there will be a new programmable task pane in Office 12 (future blog post), so it might do the trick.

# re: PivotTables V: Context menus

Wednesday, December 21, 2005 5:38 AM by Steve Hurcombe
Hi,
We have been having loads of problems finding a solution that will pivot text values.

A contrived example:

Who Question Answer
Fred How much? Not many
Fred How much? Too few
John How much? A lot
Fred When? Soon
Fred When? Quick
John When? Later


Becomes:

Who How much? When?
Fred Not many Soon
Too few Quick
John A lot Later


When we were asked by our clients if we could add this to our reports our first reaction was, "of course you can, export it to Excel and use a pivot table".

However we can't find a way to do this in either Access, Excel or even the latest SQL Reporting Services.

They all expect numerical values.

Best regards
Steve

# re: PivotTables V: Context menus

Wednesday, December 21, 2005 9:29 PM by Jean Martineau
From what I can see, these functions are the best new ones. Meanwhile, there are other types of users. For example, I just found St Var, Mode,.. on the web:
http://www.mrexcel.com/archive2/33000/37772.htm
http://www.digdb.com/excel_add_ins/median_pivot_table_roll_up/

# Dabble DB &raquo; Blog Archive &raquo; Dabble Clip #2: Column Menus

New Comments to this post are disabled
 
Page view tracker