Add slicer
add_slicerAdd a slicer or timeline to filter a PivotTable or table. Select items, hide empty ones, and connect multiple PivotTables sharing the data cache.
Instructions
Add a slicer (Insert > Slicer) or timeline that filters a PivotTable or table.
selected_items filters as clicking buttons does. A PivotTable not made by
create_pivot_table keeps its old figures until Excel recalculates on open.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | Yes | ||
| name | No | Default: the field name. | |
| path | Yes | ||
| sort | No | Item order. | ascending |
| field | Yes | Column header or field, e.g. 'Months (Date)' for a date group. | |
| sheet | Yes | Sheet for the slicer. | |
| style | No | e.g. SlicerStyleDark2, TimeSlicerStyleLight1 (timeline). | |
| target | Yes | Table or PivotTable to filter. | |
| caption | No | Default: the field. | |
| columns | No | Button columns. | |
| connect | No | More PivotTables sharing the target's data cache. | |
| timeline | No | Make a timeline instead, for a date field of a PivotTable. | |
| width_cm | No | Default: 5.1 (timeline: 9.3). | |
| height_cm | No | Default: 7.4 (timeline: 3.8). | |
| selected_items | No | Items to show. Default: all. | |
| hide_empty_items | No | Hide items without data. |