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!

Unable to insert summary/subtotal on formula

Status
Not open for further replies.

suefhmis

Instructor
Joined
Jan 24, 2002
Messages
25
Location
US
This is drivin' me nuts!
I'm using the following formula to calculate property cost:
{query.prpty_cost} * {@New Ct Spc}.
This formula, called Total Cost, is placed in my group header #3 because that's what the customer wants. Note that the formula New Ct Spc is also located in group header #3 because that's what the customer wants.
The problem I'm having is that I need to sum up all of the total costs from group #3 to display a subtotal for group #2 and I'm having no success whatsoever. I've tried the Initialize-Evaluate-Display formulas (i.e. set a counter, increment the counter, display the counter) and still can't get the total cost.
Can anyone recommend anything?
 
Can you use a running total and evaluate for each Group 3.

Running Totals have to be displayed in the footer section to work properly.

Were all your initialise-evaluate-display formulas being calculated WhilePrintingRecords? Editor and Publisher of Crystal Clear
 
couple of things you might look at:

1. Add the evaluation time function:

WhilePrintingRecords;

to each formula...this gives you total control as to when the formula's are being evaluated

2. also add to formula, Total Cost, the additional line:

EvaluateAfter({@New Ct Spc});

3. in Total Cost you might try structuring the formual something like this

WhilePrintingRecords;
EvaluateAfter({@New Ct Spc});
Numbervar OverallCost; //this is initialized to zero
//earlier
NumberVar TempCost;

TempCost := {query.prpty_cost} * {@New Ct Spc};
OverallCost := OverallCost + TempCost;

TempCost;

*******************
later in Group 2 you would have a display formula

WhilePrintingRecords;
Numbervar OverallCost;

OverallCost;

hope this helps...Jim

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top