Using a slicer to accurately show parent/child hierarchy

borntorun75

Board Regular
Joined
Jul 12, 2010
Messages
57
Hi there,

I'm new to using slicers and really like the functionality they bring to a pivot.

In the example below, I'm showing the source data (A1 to E17) and a couple of pivots. You'll see that for each department (Sales and Admin), there's a Country and Area - with Wages information for each. In respect of the Area (column C), in terms of relationships its 'parent' is the Country (column B)

So, Country USA has 4 areas (North, East, South and West). Country Ireland has one area called (all)


The first pivot (G1 to H16) is a traditional pivot (no slicers).

The second pivot (J17 to M22) is a pivot with the 3 slicers you see positioned above it.

As you can see from the screen shot, on the slicers I've currently selected Sales and Ireland. The 3rd slicer correctly shows that the only Area available to select is (all). That's highlighted in the darker blue, at the top of the list.

This third slicer also shows the Areas of the other available Countries below it (North, East, South and West). As you can see from the data, they don't apply to the selected country of Ireland in this case.

My question is can I control the contents of the 3rd slicer box to only show the Area(s) of the parent Country (in the 2nd slicer box).

Can I show that relationship and only populate the contents of child slicers based on the children its parent has ... ?

In this example, since I've selected Ireland, could the 3rd slicer box be manipulated so that it only showed "(all)"? Similarly if I selected USA as the Country, could the 3rd slicer box be manipulated so that it only showed the 4 Areas (North, East, South and West) ?

I can get by with how it is now, but I'm working on something that I want to distribute and i think it'd be a nicer solution to not show children items that don't belong to the parent.

Many thanks. I'm using Excel 2010 on Windows 7.

My usual preference is to try and achieve results by avoiding VBA, so that users don't have to 'manage' turning on macros, etc. If there's a non-VBA solution, that'd be great. However, I appreciate that sometimes VBA is the only way to resolve a problem easily.

Best regards,
Mike.



Pivotandslice_zps81f92519.gif
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I regularly do this in 2010 by creating my own custom slicer style. For each of the 4 "... with no data" items, I simply change all the settings to white.
 
Upvote 0
Found someting on another site. It seems with Excel 2013 the checkbox in the slicer settings is working and you can remove the items with no data. I think this also works in above case. Cant test it as Iam still with 2010 and here it does not work :(

Exploring Excel 2013 for BI Tip #5: Cleaning Up Slicers | Data on Wheels - Steve Hughes


Brilliant. This is the precise thing I was looking for. It'll be a good while yet before I get Excel 2013 I suspect, as I work in a large organisation and they're not quick to put the latest releases in.

However, thanks for the tip-off Tianbas. I'll be pushing to get 2013 asap.

(Would still be curious to see if this was possible, VBA-wise), but I'm glad there's a solution in-built in the newer 2013.

Best regards all,
Mike.
 
Upvote 0
cool, Excel 2013, didn't know about this. Although I have Excel 2013 on my home PC, I use Excel 2010 at work.
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,795
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top