Print Page | Close Window

Can I Sum a Running Total Field

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14543
Printed Date: 03 May 2024 at 11:55am


Topic: Can I Sum a Running Total Field
Posted By: stevetothink
Subject: Can I Sum a Running Total Field
Date Posted: 29 Sep 2011 at 6:54am
I have a running total field (RT1) that resets after a change in group1. Is it possible to sum all RT1s at the end of the report? I can't figure out how but assume it is possible somehow.

Thanks,
Steve



Replies:
Posted By: DBlank
Date Posted: 29 Sep 2011 at 7:08am

Nope.

just make another RT exactly the same as RT1 but change it to never reset


Posted By: stevetothink
Date Posted: 29 Sep 2011 at 7:16am
Thanks - i'm actually taking the RT1 and using it in a formula so I really need to sum a formula field that includes a RT field. Is that possible?


Posted By: DBlank
Date Posted: 29 Sep 2011 at 7:55am

Do you mean like the reult of an RT / the count of a field for a %?

#RT1 % count({table.field}, {table.groupfield})


Posted By: stevetothink
Date Posted: 03 Oct 2011 at 4:24am
Originally posted by DBlank

Do you mean like the reult of an RT / the count of a field for a %?

#RT1 % count({table.field}, {table.groupfield})


I've created a formula field named "@TOTAL SUM" that says sum(RT1*X). X is a factor based on the record type. Now I want to sum the formula field named "@TOTAL SUM."

Is this possible?

Thanks


Posted By: DBlank
Date Posted: 03 Oct 2011 at 4:29am
Still confused as to where you are summing these...
(RT1*X) is a value per row (detail level)
@TOTAL SUM is at a group level?
SUM(@total_sum) is for the report footer?


Posted By: stevetothink
Date Posted: 03 Oct 2011 at 7:31am
Originally posted by DBlank

Still confused as to where you are summing these...
(RT1*X) is a value per row (detail level)
@TOTAL SUM is at a group level?
SUM(@total_sum) is for the report footer?


Let me break it out a little more. This might help explain. I have a separate report for each person.

Details: (All "details" sections are suppressed)

Group1           Amount (custom formula)
R1                   10
R2                   10
R3                   10
S1                   10
S2                   10
S3                   10


Footer: (I'm using RT's to sum by group and reset after each new change in group.)

R Total for John Doe: 30
S Total for John Doe: 30

Then I'm taking the R Total and S Total for John Doe and multiplying it by a factor that is based on the Group label.

Custom formula for R Total for John Doe: 65.123
Custom formula for S Total for John Doe: 19.5264


Since I do this for each person, every employee has a single page report with the above info. I'd like to create a page at the end of this report that will sum all of the Custom formula R Totals and S Totals for everyone.


Posted By: DBlank
Date Posted: 03 Oct 2011 at 7:51am
Originally posted by stevetothink


I have a separate report for each person.
Since I do this for each person, every employee has a single page report with the above info. I'd like to create a page at the end of this report that will sum all of the Custom formula R Totals and S Totals for everyone.
 
Do you mean you have a main report that has  a sub report that runs once per employee and you want to SUM values fromt he subreport intop the main report on the last page?


Posted By: stevetothink
Date Posted: 03 Oct 2011 at 7:54am
Originally posted by DBlank

Originally posted by stevetothink


I have a separate report for each person.
Since I do this for each person, every employee has a single page report with the above info. I'd like to create a page at the end of this report that will sum all of the Custom formula R Totals and S Totals for everyone.
 
Do you mean you have a main report that has  a sub report that runs once per employee and you want to SUM values fromt he subreport intop the main report on the last page?


Unfortunately not, all of this is happening in 1 report.


Posted By: DBlank
Date Posted: 03 Oct 2011 at 8:01am

How I would do it if I undertstand your design correctly is apply it all the detail level and let it rioll up naturally.

Should not matter in this case if you multipled the row value by the R factor and then sum that result or if you sum teh row level and multiple that by the R value (as you are doing)
If you do the muliplier at the row level then you can just do a SUM at group level 1, or the the report footer



Print Page | Close Window