Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Can I Sum a Running Total Field Post Reply Post New Topic
Author Message
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet Topic: Can I Sum a Running Total Field
    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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2011 at 7:08am

Nope.

just make another RT exactly the same as RT1 but change it to never reset
IP IP Logged
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet 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?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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})
IP IP Logged
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet 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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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?
IP IP Logged
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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?
IP IP Logged
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.