Forum

Notifications
Clear all

Timed sequence through a slicer?

3 Posts
3 Users
0 Reactions
166 Views
(@aggiedave)
Posts: 1
New Member
Topic starter
 

Is there a way to either configure the slicer or create VBA code to run through the slicer buttons or a set number of them?

I have a table of data sorted by weeks. I'd like to automate running through say the last 8 weeks worth to show trend over time. Is there a way to do this?

 
Posted : 25/06/2016 12:59 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi,

Instead of writing complex codes, the easiest approach is to add a new column to your table, with a simple formula, to create the groups you want.

The formula for this new column should look like:

=IF([@[WeekNo]]>=Max([WeekNo])-8,"Last 8 Weeks","")

Refresh the pivot table, and add this new field as a slicer. The slicer will have 2 buttons, one with Last 8 Weeks, and a blank one, for older data.

In this manner, you can create any groups you want.

Catalin

 
Posted : 29/06/2016 7:33 am
(@mynda)
Posts: 4761
Member Admin
 

Good idea, Catalin. That reminds me of a post I did to show rolling 12 month periods:

https://www.myonlinetraininghub.com/excel-slicers-for-rolling-periods

Mynda

 
Posted : 29/06/2016 8:43 pm
Share: