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!

Running Total Problem 2

Status
Not open for further replies.

Cort

MIS
Apr 16, 2002
154
US
Hello all. i know a runing total is my solution to this issue but I can't pin it down exactly. Please help.

CR 8.5

2 groups, Rep(G1) and Contract (G2)

Detail field is suppress but sometimes has multiple returns which are necessary for the report so it may look like this:

Contract Amount PD March Total Amount Paid
12221 560.00 12,000
12221 324.45 12,000
12221 -120.00 12,000

Total: 764.45 12,000

And this all works just fine with a Sum RT for March paid and a MAX RT for total.

The problem I run into is when it comes time for the group summary under the Sales rep. I am having problems getting the correct total in the [total amount paid] field. I keep getting incorrect numbers because of the multiple payments during the month. It would look something like this:

Rep: Bob

Contract Amount PD March Total Amount Paid
12221 764.45 12,000
23423 978.23 8,000
33223 1100.45 30,000

Rep Total:
Contracts: Amount Paid Total Amount Paid
3 2843.13 120,000

How does one do a running total based off of a max?
Please help.
 
Assign the maximum value to a variable, and quote the variable in your report total.

i.e.

WhilePrintingRecords;
NumberVar ReportTotal;

ReportTotal := ReportTotal + Maximum({AmountPaid},{ContractID});

Then display ReportTotal in your Report Footer.

Naith
 
Set the Evaluate option of the running total --
the sum of {total_amt_paid} -- to once for each Contract_ID group.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Naith,

I believe there is no need for variables in this case.
The max value approach is not necessary because Running Totals can be set to evaluate (increment) once for any Grouping Level you choose.

Cort simply wants to increment a total once for each Contract_ID.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
I don't know if we're on the same page, but his original summing running total looks fine to me.

It's the maximum RT which appears to need addressing.

Naith
 
Naith,

Cort was using maximum just as a way to avoid double (or triple) counting of the same amount within each contract.

That approach breaks down (as Cort found out) when the amount under each contract is totaled for all contract belonging to each Sales Rep.

The mention of the MAX approach threw you off because you assumed only the MAX value within each group needs to be totaled. The situation is actually simpler then what you were imagining... :eek:)

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thanks fellas. Both solutions work :)

Ido I has originally attempted the 'evaluate on' option and it had failed. I was really suprised because I was certain I had used it before with success in exactly this situation. Lo and behold I had a formula error.

Thank You both.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top