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!

Multiple Summary Help

Status
Not open for further replies.

excalibur78

IS-IT--Management
Jan 3, 2001
66
US
I'm at a loss on how to get this report to work right. Here's what I got. It's an account balance report. Needs to look in the database and add up the total cost if the transaction type is CM, DM, or PA based on company. Then it needs to subtract that from the amount with transaction type IN and output this in a group for company. Last we need to sum this field in the report footer. I can get as far as getting the numbers by using a summary field but I can't do the subtraction as a summary of the group for some reason. The summary for the report footer should be easy justhaven't gotten that far yet. Thanks in advance for any help you can provide.
 
Try using variables to total up the values if you want to be throwing subtractions into the mix as well.

whileprintingrecords;
numbervar total1;

if {transaction_type} in ['CM','DM','PA']
then total1 := total1 + {cost};

Use another formula for the subtractions:

whileprintingrecords;
numbervar total2;

if {transation_type} = 'IN' then total2 := {cost} - total1;

Use a third formula to reset the variables, suppress it, and stick it in the back of the group footer:

whileprintingrecords;
numbervar total1;
numbervar total2;
numbervar gtotal1 := gtotal1 + total1;
numbervar gtotal2 := gtotal2 + total2;

total1 := 0;
total2 := 0;

Because you passed the values of the totals to some grand total variables (gtotal1 and 2) before you reset them, you can use the gtotals in the report footers.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top