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

Sum on Change of Formula...How To? CR9.0 1

Status
Not open for further replies.

Digitalcandy

IS-IT--Management
May 15, 2003
230
US
I can make these formulas using the "Running Total" function but how do you do it using formulas? For instance, I can make formulas that SUM but I don't know how to add the "On Change Of" feature to it.

 
Try:

sum({table.field},{table.groupedbyfield})

To get an example, create a report with a group, place a value in the details, right click it and select insert->summary->sum

This will create the field for you.

To see the syntax, open the formula editor and select the sum created from the report fields list, it will show the syntax used to create it.

-k
 
Are you referring to creating manual running totals using variables? If you were trying to get a grand total that summed on change of group, e.g., Customer ID, so that you only the first record in the group was accumulated, you would create a formula like for the detail section:

whileprintingrecords;
numbervar sumtot;

if onfirstrecord or
{table.custID} <> previous({table.custID}) then
sumtot := sumtot + {table.amt} else
sumtot := sumtot;

Then create a display formula for the report footer:

whileprintingrecords;
numbervar sumtot;

-LB
 
Thanks both of you. Ibass listed what I was trying to accomplish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top