Excel Pivot Table

Hi all

I have an excel Spreadsheet that is connected to a SQL Database. it has a list of orders on it that go back to 2009.

I would like to base a pivot table on the data but was wondering how i could make the pivot table automatically change if say i added date filters on the raw data on sheet 1 how could i make the pivot table reflect these changes also on shhet 2.

Thanks

John
pepps11976Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Rory ArchibaldConnect With a Mentor Commented:
What I am really suggesting is a SQL query that returns only a specific month's data based on a parameter. You could then use an Excel cell as the parameter value so that the table in Excel only has one month's data in it, so just refreshing the pivot table will keep it up to date. You could alternatively base the pivot directly on your SQL data and not store the data on a sheet at all (depends if you need that detail).
0
 
Rory ArchibaldCommented:
Which version of Excel?

Unless you specifically need to filter the raw data as well, I would suggest simply filtering the pivot table directly. If you do need to filter the raw data too, you will probably need code - in which case we would ideally need a sample workbook to see the data layout.
0
 
pepps11976Author Commented:
Its the 2007 version.

basically a users filters the report every month to send to our customers so generally they would filter for the current month.

And so i would like the pivot table to reflect the change.

John
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Rory ArchibaldCommented:
Would it not make more sense to have the source query filtered? Then you only have the required data in the file and the pivot table is always current.
0
 
pepps11976Author Commented:
I did try that i filtered the source data on last month a nd created a pivot table, then i changed the filter on the source data to current month but the pivot table stayed the same.

the user would be changing to the current month every month

John
0
 
Rory ArchibaldCommented:
I mean the source query not the data in the workbook. You would then simply need to refresh the pivot table.
0
 
pepps11976Author Commented:
Yes i see what you mean.

only then it would mean myself having to re query the sql data every month, not really ideal.


John
0
 
Rory ArchibaldCommented:
Do you not have to do that anyway to make sure the data is up to date?
0
 
pepps11976Author Commented:
The Sql Data is connected to a foxpro table, the sql query is refreshed every 20 mins.

And the SQL query has data init that goes back years, it has all order history etc, so i use excel to pnly pick out the information that i need.

John
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.