Confidentjohn
Board Regular
- Joined
- Mar 3, 2009
- Messages
- 73
Hi
I have a pivot table report that uses a dynamic range as its source, the data is continually growing with new data sets added each day into the data table.
To update the pivot I have added a Macro button which refreshes the pivot table, however as new dates are added each day the Value section is just constantly growing.
The Pivot Table structure is as below
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]Date[/TD]
[TD]Date[/TD]
[TD]Date[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]Product Name[/TD]
[TD]Product Cat[/TD]
[TD]01/02/14[/TD]
[TD]02/02/14[/TD]
[TD]03/02/14[/TD]
[TD]04/02/14[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]a[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]b[/TD]
[TD]4[/TD]
[TD]0[/TD]
[TD]7[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]c[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]d[/TD]
[TD]4[/TD]
[TD]6[/TD]
[TD]3[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]e[/TD]
[TD]3[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]
If I add data to the source for the 05/02/14 and refresh the table a new column will be added expanding the width of the table.
I'd like to add a filter that when the table refeshes only shows the last 3 days (for example)
Looking in the pivot report filters these are all very specific when it comes to dates, you need to know the exact range, however I want a relative filter last 3 days.
I am not adverse to the filter being applied with a bit of VBA, is there a way to find the last date and subtract 2 and these are the values to filter on?
Any help would be greatly appreciated.
Cheers
John
I have a pivot table report that uses a dynamic range as its source, the data is continually growing with new data sets added each day into the data table.
To update the pivot I have added a Macro button which refreshes the pivot table, however as new dates are added each day the Value section is just constantly growing.
The Pivot Table structure is as below
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]Date[/TD]
[TD]Date[/TD]
[TD]Date[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]Product Name[/TD]
[TD]Product Cat[/TD]
[TD]01/02/14[/TD]
[TD]02/02/14[/TD]
[TD]03/02/14[/TD]
[TD]04/02/14[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]a[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]b[/TD]
[TD]4[/TD]
[TD]0[/TD]
[TD]7[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]c[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]d[/TD]
[TD]4[/TD]
[TD]6[/TD]
[TD]3[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]e[/TD]
[TD]3[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]
If I add data to the source for the 05/02/14 and refresh the table a new column will be added expanding the width of the table.
I'd like to add a filter that when the table refeshes only shows the last 3 days (for example)
Looking in the pivot report filters these are all very specific when it comes to dates, you need to know the exact range, however I want a relative filter last 3 days.
I am not adverse to the filter being applied with a bit of VBA, is there a way to find the last date and subtract 2 and these are the values to filter on?
Any help would be greatly appreciated.
Cheers
John