Solved

Excel Pivot Table

Posted on 2012-03-12
9
173 Views
Last Modified: 2012-03-12
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
0
Comment
Question by:pepps11976
  • 5
  • 4
9 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37709056
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
 

Author Comment

by:pepps11976
ID: 37709076
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
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37709080
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
 

Author Comment

by:pepps11976
ID: 37709094
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37709108
I mean the source query not the data in the workbook. You would then simply need to refresh the pivot table.
0
 

Author Comment

by:pepps11976
ID: 37709120
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
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37709125
Do you not have to do that anyway to make sure the data is up to date?
0
 

Author Comment

by:pepps11976
ID: 37709129
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
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 37709147
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now