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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cumulative Total

Status
Not open for further replies.

LMRollins

MIS
Nov 14, 2000
120
US
Ok guys, I need some help. I have a report that reports on our weekly incoming orders for the year. Here is my problem. Let's say that week 1 had a total of 49 order and week 2 had a total of 25 orders. For week 1 the cumulative would be 49 and week 2 cumulative would be 74 which is 49 + 25 and so on for each week.

Week# Total Cumulative
Week 1 49 49
Week 2 25 74
Week 3 10 84

Unfortunately this is being done in the group header. Does anyone know how I can do this? I'm using CR 8.5 with Sql Server 2000

Help,
Lori
 
Place a formula in the report header

Code:
//@INIT
shared numbervar tot := 0;

In the report header, place the following formula

Code:
//@accumulate
shared numbervar tot

tot := tot + Gtot //Gtot is the group total you are using above.

tot


-LW
 
Do two totals, a summary total for the group and a running total for the whole report.

In the header of each group, the summary total will have the total for that group. The running total will have the total for all previous groups.

Add the two together and display the sum as 'Cumulative'.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
kskid,

I created the first formula and put it in the header but the other formula kept giving me an error when I tried to create it. It told me the rest of the text was right. What am I doing wrong?


Madawc,

Ok the group summary is working but the running total is close. When I do the running total the first number is 1 and then the next number is 1 + 49 = 50. I need that first number to be 49 and then the next line would be 49 +
25 = 74.
 
Thanks guys for the help but I found a post that solved my problem. Here it is if you're interested.

thread767-528391

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top