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

Sum a Fromula for a Group and a Grand Total

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
The report has 3 Groups in this Order.
Work Center;
Job;
Job Operation Time;

I have this formula in the Group Job. It summs the Jobs Eff for that Work Center
@RunEff
whileprintingrecords;
evaluateafter({@dblRunEst});

JBDivideByZero ({@dblRunEst},{JobOperationTimeSUMS.SumOfAct_Run_Hrs} ,0 ) * 100

What I need to do is have a total of this for the Group Work Center and then a Grand Total for the Report.
 
You're codeing the totals yourself: it is easier to let Crsytal do it. The use of Crystal's automated totals is outlined at FAQ767-6524. Worth doing a few trial reports to get familiar with them, they save a vast amount of time.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
I found the other formula to restrictive. So I created a new formula to calculate the Eff% at the Details.

@EFF%
if {JobOperationTimeSUMS.SumOfAct_Run_Hrs} = 0 then 0 else
JBDivideByZero ({Job_Operation.Est_Run_Hrs},{JobOperationTimeSUMS.SumOfAct_Run_Hrs} ,0 ) * 100

Now what I need to do is calculate the Average of these values for the Group "Work Center" and the Average for the Report Footer.
 
Please forgive the last post by me, that calculation wasn't working once i reviewed.

Below is the formula for {@dblRunEst}, this formula is part of @RunEff, which its formula details are listed above in the first post. The {@dblRunEst} works fine, and needs be be Grouped with an Average for Each Group Work Center and Average for the Report Footer.
{@dblRunEst}=
if {JobOperationTimeSUMS.SumOfAct_Run_Hrs} = 0 then
0
else if {Job_Operation.Est_Run_Hrs} = 0 then
0
Else
(
if {Job.Make_Quantity} = 1 then
(
if{Job_Operation.Status} = "C" Then
{Job_Operation.Est_Run_Hrs} *
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Hrs},{Job_Operation.Act_Run_Hrs} ,0 )
Else If {Job_Operation.Run_Pct_Complete} <> 0 Then
({Job_Operation.Est_Run_Hrs}*{Job_Operation_Time.Run_Pct_Complete}/100)*
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Hrs},{Job_Operation.Est_Run_Hrs} ,0 )
else
(
if {Job_Operation.Act_Run_Hrs} <= {Job_Operation.Est_Run_Hrs} Then
{JobOperationTimeSUMS.SumOfAct_Run_Hrs}
Else
{Job_Operation.Est_Run_Hrs}*
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Hrs},{Job_Operation.Act_Run_Hrs} ,0 )
)
)
else if {Job_Operation.Run_Method} = "FixedHrs" Then
(
if {Job_Operation.Status}= "C" Then
{Job_Operation.Est_Run_Hrs} *
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Hrs},{Job_Operation.Act_Run_Hrs} ,0 )
Else if {Job_Operation.Act_Run_Qty} > 0 Then
(
If {Job.Make_Quantity} = 0 Then
0
Else if {JobOperationTimeSUMS.SumOfAct_Run_Qty} <= {Job.Make_Quantity} Then
({Job_Operation.Est_Run_Hrs} / {Job.Make_Quantity}) * {JobOperationTimeSUMS.SumOfAct_Run_Qty}
Else
{Job_Operation.Est_Run_Hrs} *
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Hrs},{Job_Operation_Time.Act_Run_Hrs} ,0 )
)
Else if {Job_Operation_Time.Run_Pct_Complete} <> 0 Then
({Job_Operation.Est_Run_Hrs}*{Job_Operation.Run_Pct_Complete}/100)*
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Hrs},{Job_Operation.Act_Run_Hrs} ,0 )
Else
(
if {Job_Operation.Act_Run_Hrs} <= {Job_Operation.Est_Run_Hrs}Then
{JobOperationTimeSUMS.SumOfAct_Run_Hrs}
Else
{Job_Operation.Est_Run_Hrs}*
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Hrs},{Job_Operation.Act_Run_Hrs} ,0 )
)
)
Else
(
if {Job_Operation.Status} = "C" Then
{Job_Operation.Est_Run_Hrs} *
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Qty},{Job_Operation.Act_Run_Qty} ,0 )
Else if {Job_Operation.Act_Run_Qty} <= {Job.Make_Quantity} Then
{JobOperationTimeSUMS.SumOfAct_Run_Qty}*
{Job_Operation.Est_Run_Per_Part}
Else
{Job_Operation.Est_Run_Hrs}*
JBDivideByZero ({JobOperationTimeSUMS.SumOfAct_Run_Qty},{Job_Operation.Act_Run_Qty} ,0 )
)
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top