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

Sum Formula field

Status
Not open for further replies.

ruan123

Programmer
Jul 23, 2004
23
ZA
I have a report with two groups and four formula fields. I can sum three of the formula fields by using the Insert Summary button for the different groups, but when I click on the fourth formula the button is disabled. I've tried everything that I know of, Running Total Fields, created a new formula and tried to sum the other formula nothing works. My formula is : CostPrice * 0.1. Is it maybe because I multiply in this formula, the other I only add and subtract?
 
Is "CostPrice" a formula, too? If it is simply a table field, your formula would be available for inserting summaries on. Please share the contents of "CostPrice".

You could try the following, where {@yourformula} = CostPrice * .01:

//{@accum} to be placed in the detail section:
whileprintingrecords;
numbervar sumcostprice := sumcostprice + {@yourformula};

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar sumcostprice;

If you are summarizing at the group level, then add a reset formula to the group header:

//{@reset}:
whileprintingrecords;
numbervar sumcostprice := 0;

And then place the display formula in the group footer instead.

-LB
 
Yes CostPrice is a formula, and I want to place the summary field in the second group footer, not the report footer.
 
Did you try my suggestion? If you want to summarize in GF#2, then place the reset in GH#2. Also, if this doesn't work, and as I suggested earlier, please share the contents of {@CostPrice} and any formulas you use within that formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top