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

Group totals for formulas containing running totals 2

Status
Not open for further replies.

Lancedac

MIS
Apr 6, 2003
14
US
CR 8.5

My report looks like this:

CustomerID Period1 period2 period3

Group IDCUST
Details: IDCUST netsales1 netsales2 netsales 3

netsales is a formula containing the sum of running totals for invoices and credit notes that meet conditons.

The detail section is conditioned to only consider invoices and credit notes from other available document types.

How do I create a formula that will sum netsales for each period and reset at the group level. I get errors trying to do more running totals apparently because netsales already contains running totals. And, if I try something like sum({netsales1},{AROBL.IDCUST}) I get the error "summary could not be created". Thanks.
 
Use variables like this:

//{@reset} to be placed in the group header:
whileprintingrecords;
numbervar sumnet1;
numbervar sumnet2;
numbervar sumnet3;

if not inrepeatedgroupheader then (
sumnet1 := 0;
sumnet2 := 0;
sumnet3 := 0
);

//{@accum} to be placed in the details section:
whileprintingrecords;
numbervar sumnet1 := sumnet1 + {@netsales1};
numbervar sumnet2 := sumnet2 + {@netsales2};
numbervar sumnet3 := sumnet3 + {@netsales3};

//{@displsumnet1} to be placed in the group footer:
whileprintingrecords;
numbervar sumnet1;

//{@displsumnet2} to be placed in the group footer:
whileprintingrecords;
numbervar sumnet2;

//{@displsumnet3} to be placed in the group footer:
whileprintingrecords;
numbervar sumnet3;

-LB
 
lb,

You used 'inrepeatedgroupheader' function in the reset formula. Is this so that if the Header is repeated on another page it doesn't reset over again?

Thanks lb,

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top