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

running total for a calculated currency field

Status
Not open for further replies.

rq

Programmer
Jun 13, 2002
56
US

I need to create a running total that will be displayed on the group and report footers.

The data comprises of disbursement records. Each disbursement record includes the gross amount (using currency format). A set of disbursements is grouped by its transaction id. Thus, I defined the transaction id as a group. I would like to sum the gross amount only once as it is displayed on the group footer. And also sum that gross amount within the report footer.

I defined 3 formula fields. These are:
** ResetGAmount: if not InRepeatedGroupHeader
then Global currencyVar nGAmountRT := 0;
** RTGAmount: if not InRepeatedGroupHeader
then Global numberVar nGAmountRT := nGAmountRT + iif({disb count}=1,gross amount,0)};
** DisplayGAmount: WhilePrintingRecords;
Global currencyVar nGAmountRT ;

What am I missing in the above fields so that I can display the info properly on the report?
 
Perhaps I misunderstand your requirement, but place the gross amount in the details, right click it and select insert summary->sum and also select Insert Grand Total Fields.

Now you can delete the gross amount field if you'd like, or even suppress the details.

-k
 

SynapseVampire, you are right. My fault for not making it clear. Let me give you an example of how the compute should work. Listed below is an example of a group of disbursements:

Record Gross Amount Disbursement Amount
====== ============ ===================
101 5000 1250
102 5000 1250
103 5000 1250
104 5000 1250

On the group footer, the gross amount will display 5000 and the total disbursement amount will state 5000.


 
Since gross amount already has the summary, just palce it in the footer.

Right click the disbursement amount and follow the above instructions for the other summary/total amounts.

-k
 

thanks so much SynapseVampire !!!!
 

I stand corrected, SynapseVampire. When I ran a test report and followed your suggestion, the main group footer summed up a disbursement group to 20000 when it should've been 5000.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top