How do I get running 12 months of data using date filter?

I am using Excel 2007 connected to a SQL DB and use pivot tables for 
reporting purposes.  I have multiple years worth of data that I access, but 
want to limit my pivot table to display just the last 12 months.  I can't 
seem to find a way to do this, but am sure someone must have solved this 
problem already.  I consider myself pretty Excel savvy, but I'm no programmer 
so hold the VB please.

Thansk!
0
Utf
1/13/2010 6:02:01 PM
excel.misc 78881 articles. 5 followers. Follow

4 Replies
4656 Views

Similar Articles

[PageSpeed] 4

Why don't you add a helper column that determines if the data is within the 
last year.  

Do something like 
if(A1 > date(year(Today())-1,month(today()),day(today())), "YES","NO")

hopefully I have all of the parens.   PUt that helper column in as a page 
field.
-- 
HTH,

Barb Reinhardt



"68jcode" wrote:

> I am using Excel 2007 connected to a SQL DB and use pivot tables for 
> reporting purposes.  I have multiple years worth of data that I access, but 
> want to limit my pivot table to display just the last 12 months.  I can't 
> seem to find a way to do this, but am sure someone must have solved this 
> problem already.  I consider myself pretty Excel savvy, but I'm no programmer 
> so hold the VB please.
> 
> Thansk!
0
Utf
1/13/2010 6:31:02 PM
I can't do a helper column because the data is in a SQL DB that I am 
accessing, not just in another worksheet that I can manipulate.  Any other 
thoughts?


"Barb Reinhardt" wrote:

> Why don't you add a helper column that determines if the data is within the 
> last year.  
> 
> Do something like 
> if(A1 > date(year(Today())-1,month(today()),day(today())), "YES","NO")
> 
> hopefully I have all of the parens.   PUt that helper column in as a page 
> field.
> -- 
> HTH,
> 
> Barb Reinhardt
> 
> 
> 
> "68jcode" wrote:
> 
> > I am using Excel 2007 connected to a SQL DB and use pivot tables for 
> > reporting purposes.  I have multiple years worth of data that I access, but 
> > want to limit my pivot table to display just the last 12 months.  I can't 
> > seem to find a way to do this, but am sure someone must have solved this 
> > problem already.  I consider myself pretty Excel savvy, but I'm no programmer 
> > so hold the VB please.
> > 
> > Thansk!
0
Utf
1/13/2010 7:23:01 PM
Hi,

Not sure if this will help, but worth a try.
How exactly are you accessing the information in the SQL DB, I'm assuming 
you are using the Microsoft Query through ODBC etc...?

If so, you probably have a field available with a date of transaction, 
restrict this field with a filter

In excel right click on the data you are accessing from SQL, and select 
'Table' then 'edit query' this will bring up a query wizard.
CLick next and go to the 'Filter Data' screen, here you can select your date 
field and apply the criteria to restrict it to the year you require.

Hopefully this will help, if not could you provide a bit more info on how 
your data is extracted from SQL

Cheers

"68jcode" wrote:

> I can't do a helper column because the data is in a SQL DB that I am 
> accessing, not just in another worksheet that I can manipulate.  Any other 
> thoughts?
> 
> 
> "Barb Reinhardt" wrote:
> 
> > Why don't you add a helper column that determines if the data is within the 
> > last year.  
> > 
> > Do something like 
> > if(A1 > date(year(Today())-1,month(today()),day(today())), "YES","NO")
> > 
> > hopefully I have all of the parens.   PUt that helper column in as a page 
> > field.
> > -- 
> > HTH,
> > 
> > Barb Reinhardt
> > 
> > 
> > 
> > "68jcode" wrote:
> > 
> > > I am using Excel 2007 connected to a SQL DB and use pivot tables for 
> > > reporting purposes.  I have multiple years worth of data that I access, but 
> > > want to limit my pivot table to display just the last 12 months.  I can't 
> > > seem to find a way to do this, but am sure someone must have solved this 
> > > problem already.  I consider myself pretty Excel savvy, but I'm no programmer 
> > > so hold the VB please.
> > > 
> > > Thansk!
0
Utf
1/13/2010 9:06:01 PM
Thanks for the response.  This really doesn't help me as it's the same 
concept as applying the filter on the "date created" field in my pivot table. 
 I'm not just trying to limit the date range to greater than, less than or 
between etc., which are the typical filters.  I need to just pull the last 12 
months, which I'm assuming requires some logic or a calculation, which I am 
not sure can be done in a pivot table.  Any thiughts?


"Paullyie" wrote:

> Hi,
> 
> Not sure if this will help, but worth a try.
> How exactly are you accessing the information in the SQL DB, I'm assuming 
> you are using the Microsoft Query through ODBC etc...?
> 
> If so, you probably have a field available with a date of transaction, 
> restrict this field with a filter
> 
> In excel right click on the data you are accessing from SQL, and select 
> 'Table' then 'edit query' this will bring up a query wizard.
> CLick next and go to the 'Filter Data' screen, here you can select your date 
> field and apply the criteria to restrict it to the year you require.
> 
> Hopefully this will help, if not could you provide a bit more info on how 
> your data is extracted from SQL
> 
> Cheers
> 
> "68jcode" wrote:
> 
> > I can't do a helper column because the data is in a SQL DB that I am 
> > accessing, not just in another worksheet that I can manipulate.  Any other 
> > thoughts?
> > 
> > 
> > "Barb Reinhardt" wrote:
> > 
> > > Why don't you add a helper column that determines if the data is within the 
> > > last year.  
> > > 
> > > Do something like 
> > > if(A1 > date(year(Today())-1,month(today()),day(today())), "YES","NO")
> > > 
> > > hopefully I have all of the parens.   PUt that helper column in as a page 
> > > field.
> > > -- 
> > > HTH,
> > > 
> > > Barb Reinhardt
> > > 
> > > 
> > > 
> > > "68jcode" wrote:
> > > 
> > > > I am using Excel 2007 connected to a SQL DB and use pivot tables for 
> > > > reporting purposes.  I have multiple years worth of data that I access, but 
> > > > want to limit my pivot table to display just the last 12 months.  I can't 
> > > > seem to find a way to do this, but am sure someone must have solved this 
> > > > problem already.  I consider myself pretty Excel savvy, but I'm no programmer 
> > > > so hold the VB please.
> > > > 
> > > > Thansk!
0
Utf
1/15/2010 2:47:01 AM
Reply:

Similar Artilces:

Filtered Lookups
Hi, I wanted to filter values in one lookup (Lkup2 ) based on the selection made in another lookup (Lkup1) Is there a way I can achieve this without 1 - going for any paid products or 2 - modifying the CRMWeb\_controls\lookup\lookupsingle.aspx page Thank you very much Check this out, it has it http://www.microsoft.com/downloads/details.aspx?familyid=634508DC-1762-40D6-B745-B3BDE05D7012&displaylang=en Have a look here: http://www.eggheadcafe.com/software/aspnet/35418198/how-to-restrick-a-lookup.aspx this thread was about filtering the lookup of "primary contact" to contacts ...

Won't Run #2
My MS Money 2002 version all of a sudden would not open no matter where we tried. I'm running windows XP and all other programs are fine.Any suggestions? Try reading some previous postings in this NG. It is all explained. -- Regards Bob Peel, Microsoft MVP - Money Hints/Tips http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny UK Wishes/Suggestions mnyukwsh@microsoft.com "Ed" <anonymous@discussions.microsoft.com> wrote in message news:10afb01c3f446$5aa5f6e0$a001280a@phx.gbl... > My MS Money 2002 version all of a sudden would not open > no m...

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

Using Outlook Custom Forms through OWA
Hi all, Is there any way to implement this? We have an Exchange 2003 server with Sp2. Users out of office hope to use outlook custom forms through OWA. Can this be done? ...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

IIf Statement in Query Criteria 12-11-09
I have the following code in a query: SELECT qryPointsWithDropOffDates.EMPLOYEEID, qryPointsWithDropOffDates.SSN, qryPointsWithDropOffDates.NAME, qryDisciplineNoticesReprint.LASTINCIDENTDATE, qryPointsWithDropOffDates.INCIDENTDATE, qryPointsWithDropOffDates.TYPESHORT, qryPointsWithDropOffDates.POINTVALUE FROM qryDisciplineNoticesReprint INNER JOIN qryPointsWithDropOffDates ON qryDisciplineNoticesReprint.SSN=qryPointsWithDropOffDates.SSN WHERE (((qryPointsWithDropOffDates.INCIDENTDATE) Between [qryDisciplineNoticesReprint.CALCDATE] And [qryDisciplineNoticesReprint.LASTINCIDENTD...

compact database at run time
hi How can i compact my access database programmatically .. In MSDN they gave a code like #import "C:\PROGRAM FILES\COMMON FILES\System\ado\Msado15.DLL" #import "C:\PROGRAM FILES\COMMON FILES\System\ado\MSJRO.DLL" no_namespace try { IJetEnginePtr jet(__uuidof(JetEngine)); jet->CompactDatabase( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\nwind2.mdb", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\abbc.mdb;" \ "Jet OLEDB:Engine Type=4"); } catch(_com_error &e) { ::MessageBox(NULL, (LPCTSTR)e.De...

need to put a condition to run macro
Hello I have the following macro assigned to a button. I wanted to modify the same to do the following. I need to run this macro only if the value in C66=2 When I am running this macro, it paste the value '1' in C66. So If click the button again it will not run unless the value change to 2 Hope someone help me. Thanks Toms Public Sub CopyValues() With Range("M" & Rows.Count).End(xlUp).Offset(1, 0) .Value = .Offset(-1, 0).Value + 1 .Offset(0, 1).Resize(1, 2).Value = Range("p1:q1").Value Range("b5").Value = .Value End With Range("C66"...

OT
Slightly off topic - counldn't find any appropriate group on my server. I'm running a prog in debug mode (VC7.1.3088) for several hours or more and I'm sending a lot of output via ATLTRACE2 to the output window. In the past I've had a couple visual studio crashes and I wondered if there was any restriction on the amount of data the output window can safely take - or there are any bugs linked to this. TIA "Joe" <not@here.com> wrote in message news:4230fa32$0$10953$cc9e4d1f@news-text.dial.pipex.com... > Slightly off topic - counldn't find any appr...

need a date look here
This is a multi-part message in MIME format --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Get all the hots girls @ www.pearlymae.com --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/html Content-Transfer-Encoding: quoted-printable <html> <head> <meta name=3D"GENERATOR" content=3D"Microsoft FrontPage 6.0"> <meta name=3D"ProgId" content=3D"FrontPage.Editor.Document"> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindow...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

AutoArchive using VBA CDO CdoPR_AGING_PATH
I am trying to programatically change the path to the archive file. My pst has may folders and I dont want to change the path on each one by hand. Using the code I can change the GRANULARITY and the PERIOD but the path wont change. ( I am verifying the settings by right clicking the folder and selecting AutoArchive). I have tested in both Outlook 2002 and 2003. On 2003 I was able to change the path when I ran the code the first time but subsequent attempt failed to change the path. Strangely when I view the path (objMessage.Fields.Item(CdoPR_AGING_PATH).Value) via code after I change it, i...

Running code when hyperlink clicked
Hello, I am definitely baffled. I am trying to run code when a hyperlink is clicked. I am using Excel 2007, the hyperlink is created in a cell on Sheet 1 using "=hyperlink()", the hyperlink is to a video clip, and events are definitely enabled. I had tried two things, either of which would be fine: 1. I put the following code in Sheet1, and it did not respond at all. What am I doing wrong? Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) Sheets("Sheet1").Range("B1") = "It Ran" End Sub 2. I put the following...

Likert scale calculation
I have used the following table in my survey: Frequency of use - check which on is applicable: every few hours every few mins every few secs item1 item2 item3 .. .. .. item10 so the sample data looks like this: id item1 item 2 ............. item10 1 hours hrs ................. mins 2 secs hrs ................. mins 3 mins hrs ................. mins I want to add up the hours secs mins for each item..for example (from the above sample): ev...

Same file exists when I run Optimizer
Dear Sir/Madam, While I was running the Optimizer to utilize free space I met a error message during moving the files C:\exchsrvr\imcdata into D:\exchsrver\imcdata " There is the same file, ...., in the destination.". But I could see for sure that there was No files in the destination. Could you let me know how to fix it? Thanks a lot in advance. KC "�̱�ö" <kclee@jcsworld.com> wrote: >While I was running the Optimizer to utilize free space I met a error >message during moving the files C:\exchsrvr\imcdata into >D:\exchsrver\imcdata " There is...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Restrict spreadsheet to data entry only
Fairly new to Excel. Once I've set up the structure of my spreadsheet, and entered the formulae for calculated cells etc, how can I ensure that the spreadsheet is used just for data entry and that the structure cannot be altered in any way? TIA You can use protection. You need to go to every cell you want for data entry and unprotect tha cell. You can select multiple cells... right mouse click... Then hi format cells... The last tab says protection, select it and click th check box to unprotect these items. Now you can then in the menu bar hit Tools... Protection... and the Protect...

Static Range, Dynamic Chart Data
I have read some great tips on making my chart dynamic that involv changing the range. The chart I would like to create is a 12 month lin chart. I want the chart to always be 12 months in length, but the poin to simply not be plotted if the value of the cell "blank". In othe words, stop the line short of the end of the plot area. The 12 months of charted cells have a formula lik =IF(A1=0,"",SUM(A1:A6)). So you see a blank cell if A1 is 0. But th chart shows this as a zero value. If I delete the contents the char does what I would like. Is there a way to simply change the ...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

Keeping data without losing Formula's
I have a worksheet (named monthly) with a column of data under a certain month (which will change each time data is entered - stocktake). However this column needs to be edited each month and has formula's in it so it will work (not always the same data in the column). I decided to put this data into a yearly sheet under the particular month. The only way I can do it at the moment is to copy and paste special. How do I (or is there a way to) put this data in a sheet that has all the months but under the month that is signified. In other words I don't want formula's in the yearl...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Excel VBA / Data Sorting / Maniputaltion
i have a long list, which i imported from other data base. The problem is: 1. In each cell, besides data (data is in alphabates) there are som numeric characters which i dont want . How can i get rid of all those unwanted numbers from data, from all th list? 2. The data is in every second row, ie. one row is empty. How can i Delete those empty/blank rows from the list -- Message posted from http://www.ExcelForum.com 1. I think we will need to see a sample of your data 2. Sort the data -- Message posted from http://www.ExcelForum.com I am sending the sample data file... ...

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Stupid Junk Filter Doesn't Work
I have oulook 2002 (xp). The stupid junk filter doesn't work and I can't figure out how to make it move junk mail to my deleted items so that i don't have to look at them in my inbox. Anyone have any suggestions? Upgrade to 2003. "Christy" <charrison@loanwhiz.com> wrote in message news:63de01c40155$1c4d1c40$a301280a@phx.gbl... > I have oulook 2002 (xp). The stupid junk filter doesn't > work and I can't figure out how to make it move junk mail > to my deleted items so that i don't have to look at them > in my inbox. > > Anyone h...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...