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

Cannot summerize a formula

Status
Not open for further replies.

rixx

IS-IT--Management
May 20, 2002
15
US
Hello All,

I need to show duplicate records in the details section of a report but I do not want the amounts to double when I do a total on that field. I created a formula which does this:

Code:
If Previous ({EmployeeDetail.LoanNumber}) = {EmployeeDetail.LoanNumber} then 0 
else {EmployeeDetail.TotalLoanAmount}

This formula works and prints a zero amount for the duplicate, but I cannot get a total for the formula. Is there something that I'm missing? Is there a better way to do this? Any suggestions would be appreciated.

Regards,

Rick Dayao
 
You have options here, the simplest might be to just use a Running Total:

Place {EmployeeDetail.TotalLoanAmount} as the field to Sum

In the evaluate use a formula area:

previous({EmployeeDetail.LoanNumber}) <> {EmployeeDetail.LoanNumber}

You can also reset it at any group level or not at all.

OR

you can roll your own totals:

In the group header create a formula like:
whileprintingrecords;
global numbervar MySummary :=0;

In the details section create a formula like:

whileprintingrecords;
global numbervar MySummary;
If Previous ({EmployeeDetail.LoanNumber}) <> {EmployeeDetail.LoanNumber} then MySummary := MySummary+
{EmployeeDetail.TotalLoanAmount}

Now you can create a formula in the group footer to display the total like:
whileprintingrecords;
global numbervar MySummary;
MySummary

-k kai@informeddatadecisions.com
 
Thanks for the assist. The running total evaluating on the formula worked perfectly.

rixx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top