Filtering with Slicers – a Graphical Way to Filter Data
Slicers are a fairly new Excel feature, introduced with Excel 2010, and have become quite popular as a result. Basically, slicers are a graphical way to filter data, much like the way the Filter fields filter the data, but with an artistic flair.
First and foremost, it needs to be understood that slicers can be used with pivot tables AND regular tables. They are created using the same process and are used to filter data in the same way.
You can select any Pivot table field as a slicer candidate. After the slicers are created you can click the filter values to filter your pivot table. When you are using a region field as a slicer and click on it, the Region and Market fields are usually related. For example, if we have a West Coast Region and select its slicer, it will automatically highlight the markets associated with the West Coast Region, i.e. Los Angeles, San Francisco, Seattle, and Portland markets.
Another advantage of using slicers is that you can link each slicer to more than one pivot table. Any filter you apply to your slicer can be applied to several pivot tables.
The Timeline – Great for Filtering Dates
The Timeline is actually categorized as a slicer as well, although the Timeline has come to Excel a little later, with Excel 2013 being its first version. The Timeline slicer works the same way as a standard slicer in the sense that it lets you filter a pivot table using a visual selection instead of the standard filter fields. The difference with the Timeline is that it is designed to work exclusively with date fields, providing a great visual interface to filter and group the dates in a pivot table.
Keep in mind that to create a Timeline slicer, a pivot table must contain a field where all of the data is formatted as a date. You can’t just have a column of data filled in with some dates. All of the values in your date field must be formatted as a valid date. If only one value in your date column is blank or is not a valid date, Excel will not create the Timeline slicer.
Slicers are a fairly new Excel feature, introduced with Excel 2010, and have become quite popular as a result. Basically, slicers are a graphical way to filter data, much like the way the Filter fields filter the data, but with an artistic flair.
First and foremost, it needs to be understood that slicers can be used with pivot tables AND regular tables. They are created using the same process and are used to filter data in the same way.
You can select any Pivot table field as a slicer candidate. After the slicers are created you can click the filter values to filter your pivot table. When you are using a region field as a slicer and click on it, the Region and Market fields are usually related. For example, if we have a West Coast Region and select its slicer, it will automatically highlight the markets associated with the West Coast Region, i.e. Los Angeles, San Francisco, Seattle, and Portland markets.
Another advantage of using slicers is that you can link each slicer to more than one pivot table. Any filter you apply to your slicer can be applied to several pivot tables.
The Timeline – Great for Filtering Dates
The Timeline is actually categorized as a slicer as well, although the Timeline has come to Excel a little later, with Excel 2013 being its first version. The Timeline slicer works the same way as a standard slicer in the sense that it lets you filter a pivot table using a visual selection instead of the standard filter fields. The difference with the Timeline is that it is designed to work exclusively with date fields, providing a great visual interface to filter and group the dates in a pivot table.
Keep in mind that to create a Timeline slicer, a pivot table must contain a field where all of the data is formatted as a date. You can’t just have a column of data filled in with some dates. All of the values in your date field must be formatted as a valid date. If only one value in your date column is blank or is not a valid date, Excel will not create the Timeline slicer.
The Timeline slicer allows you to quickly switch between years, quarters, months, and days, adding to its versatility.
Practice Exercise 20: Understand how to create slicers to filter a pivot table.
Still use the data file, RANGE TO TABLE TO PIVOT TABLE2.
FIGURE 1
|
FIGURE 2
|
The resulting pivot table is shown in FIGURE 3.
FIGURE 3
FIGURE 4 – PivotTable Design Tab Toolbar
STEP 8: On the Insert Slicers box, check the boxes for the pivot table fields that you want to have slicers used with (FIGURE 9).
Check the following boxes on the Insert Slicers dialog box:
The resulting pivot table with 3 slicers is shown below IN FIGURE 10. |
FIGURE 9
|
FIGURE 10
STEP 10: Click the Desktops button with mouse.
Desktops button is now highlighted, and the Desktops category is being displayed. When only one category is highlighted, that means filtering action is occurring. The other two categories, Laptops and Tablets buttons are not illuminated and therefore are not being displayed (FIGURE 12). |
FIGURE 12
|
STEP 11: To display more than one category, hold down the Control key and while it is depressed, click on the other category desired. You can also click and drag your mouse to select the second category if it is directly below the first selection. Do this procedure for selecting any additional categories.
Hold down the Control key and select the Laptop button. The Desktops and Laptops buttons are illuminated and those categories are displayed (FIGURE 14). |
FIGURE 14
|
STEP 13: The “Category” slicer shown on the right has 3 of its buttons highlighted, meaning that the slicer is currently showing Desktops, Laptops, and Tablets categories in the pivot table (FIGURE 17).
The “Clear Filter” icon in the top right corner of the slicer is used for resetting the slicer back to its default, non-filtering mode (FIGURE 18). |
FIGURE 17
|
FIGURE 18
|
FIGURE 22 – Slicer Tab with Toolbar
STEP 17: Click on the “Category” slicer (do not click on a button).
When you click on any slicer, the Slicer contextual tab appears. It does not appear as a contextual tab when clicking on a pivot table cell, but only when clicking on a slicer. (FIGURE 22).
When you click on any slicer, the Slicer contextual tab appears. It does not appear as a contextual tab when clicking on a pivot table cell, but only when clicking on a slicer. (FIGURE 22).
This is the end of this section. To continue, go to Module 4 Section 4.2 Create a Pivot Table Timeline; Practice Exercise 21