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

How to summarize formula, which has a running total?

Status
Not open for further replies.

something99

Technical User
Jun 25, 2003
2
NZ
There are three groups in the report. And I do not know how to get sbtotals and a grand total for a formula containing a running total.
The formula is:
{#RTotal0}/{@ffectiveRate} where
#RTotal0 is a coditional running total reset on a group change;
@ffectiveRate is a formula, which returns a NumerVar WhilePrintingRecords.
I am using Crystal 8.5
 
try this

In the report header place this formula

****************

//@InitializeGrandTotal

WhilePrintingRecords;
NumberVar GrandTotal := 0;

****************

In the Group header place this formula

****************

//@InitializeSubTotal

WhilePrintingRecords;

if not inRepeatedGroupHeader then
NumberVar Subtotal := 0;

****************

Where the current formula - {#RTotal0}/{@ffectiveRate} - is being calculated change it to the following

****************

//@NewDetail

WhilePrintingRecords;
NumberVar Subtotal;
NumberVar Grandtotal;
NumberVar Total;

if {@ffectiveRate} <> 0 then
Total := {#RTotal0}/{@ffectiveRate}
else
Total := 0;

Subtotal := Subtotal + Total;
Grandtotal := Grandtotal + Total;

Total;

****************

Now place the display for the subTotal and GrandTotal where they belong

****************

//@DisplaySubTotal

WhilePrintingRecords;
NumberVar Subtotal;

Subtotal;

****************

//@DisplayGrandTotal

WhilePrintingRecords;
NumberVar Grandtotal;

Grandtotal;


****************

This should work for you


Jim Broadbent
 
Hi Jim,
This did not work for me. But I am not sure I know how to reply to you.
Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top