Solved

Excel Pivot Table

Posted on 2012-03-12
9
166 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

760 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

20 Experts available now in Live!

Get 1:1 Help Now