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!

sum a calculated field... 1

Status
Not open for further replies.

bv0719

MIS
Dec 19, 2002
131
US
Still fighting with this one. I've tried a running total but the option is not there. How can I summarize the amount of a field that is a calculation of a shared variable - {field}?? I have a report that returns an amount to a shared variable in the details section. The amount is already a summary of the field from the subreport. I then subtract this amount from the budget amount and end up with a variance. All of this works fine. The problem is getting the variance amount to summarize. Please Help. Running out of time.
thanks,
Bill
 
Create another formula to sum it:

whileprintingrecords;
numbervar TheShared := {table.budget}-TheShared;
numbervar SumTheShared := SumTheShared+TheShared

Use this after the shared variable is returned.

-k
 
k,
Maybe I'm not reading this correct, but I already have the {table.budg}-@shared. This is my @variance formula in the Details section. Would this formula do the calculation again in order to sum it?

BV
 
This is a seperate formula which does not get reset, note that it sums itself with the same thing as your shared variable. Just don't reset it and you can then reference it in the end, as in:

whileprintingrecords;
numbervar SumTheShared;
SumTheShared

-k

 
K,

Using this formula in the details C section returns an amount that seems like a running total. Details C is usually suppressed. If I don't supress the value is returned to GF1.
whileprintingrecords;
numbervar mtdsum := {GLBUDG.MTDAmt}-{@SHARED};
numbervar Summtdsum := Summtdsum+mtdsum

It treats negative amount as posistives however and keeps adding. If I put the formula in GF1 with the section supressed zeros are returned. The section needs to be supressed. ??

BV
 
All Set! A little tweaking the formula and all the values worked out just fine. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top