Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

YTD Running Total

Status
Not open for further replies.

crystalhelp

Programmer
May 13, 2002
56
0
0
CA
My report has three groupings (Year, Month, Branch). I wrote a stored procedure that successfully returns incidences to be tallied for a specified time period, plus incidences prior to the specified period, necessary for a ytd calulation. I have a branch total, monthly total, and a report total plus all those but based on ytd. See my simplified illustration:

January

Branch Count YTD Count

Branch 1 4 4 ** (see comment)
Branch 2 8 8 ** (see comment)
Total 12 12 (is correct)

February

Branch 1 6 6 (should be 4 + 6 = 10)
Branch 2 9 9 (should be 8 + 9 = 17)
Total 15 27 (is correct)
Total 27 27 (is correct)

** In this example, January YTD is correct, but it wouldn't be correct if the first month in the report is February, because as you can see the branches are resetting themselves. I've played around with the running total, and I have gotten different results, but so far not the right result. Does anyone know the formula to get it to do what I want it to?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top