Print Page | Close Window

Average Summary of formula field with Sum?

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=6842
Printed Date: 26 Apr 2024 at 9:50pm


Topic: Average Summary of formula field with Sum?
Posted By: RafaZa
Subject: Average Summary of formula field with Sum?
Date Posted: 24 Jun 2009 at 6:59am
Hello,
 
I know there should be a way to do this, I just don't know how. I need to produce an average summary of mailto:%7b@TrimPercent - {@TrimPercent }, which is placed in the details part of my report, but Crystal Reports doesn't give me that option because there is a SUM in part of the formula:
 
mailto:%7b@TrimPercent - {@TrimPercent } = Totext(( mailto:%7b@Trim - {@Trim } * 100 ) / mailto:%7b@PaperWidth - {@PaperWidth }) + '%'
 
where
mailto:%7b@Trim - {@Trim } =
(({report_CorrugatorProductionView.PaperWidth}) /1000000) - Sum ( mailto:%7b@OrderWidth - {@OrderWidth }, {report_CorrugatorProductionView.SetupId})
 
mailto:%7b@PaperWidth - {@PaperWidth } = {report_CorrugatorProductionView.PaperWidth}/ (1000000)
 
mailto:%7b@OrderWidth - {@OrderWidth } = {report_CorrugatorProductionView.Outs} * {report_CorrugatorProductionView.Width} / 1000000
 
How can I insert a summary for @TrimPercent? I have been trying to take out SUM of the formula and do a Running Total of that part but didn't work. I would appreciate any suggestions or thoughts about this. Thanks in advance.
 
-RZ 
 



Replies:
Posted By: lockwelle
Date Posted: 24 Jun 2009 at 11:31am
create a shared variable, actually 2, one that is the running sum and the other how many items.  Then increment the values accordingly.
 
When you want to display the average you would write a formula that calculates it....don't forget to reset the variables if you change groups or whenever the average should start over.
 
HTH



Print Page | Close Window