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

Group Subtotal and Grand Total 1

Status
Not open for further replies.

esings2him

Programmer
Nov 12, 2010
21
US
I am trying to get the group subtotal and ultimately the grand total of the fields I am trying to sum. In my report, I am calculating the cash balance of all open PO's by their due date. I am using the 3 formula method where I have a running total thats resetting to 0 that's working properly, but I'm not getting the subtotal or grand total. Here are my formulas and their placement on the report:

CB by Due Date Reset-group header
WhilePrintingRecords;
Global NumberVar Duedate := 0;

Cost Balance By Due Date-details section
WhilePrintingRecords;
Global NumberVar Duedate;

Duedate := Duedate + {@Cost Balance}

Total Commitment-when I place it in the group or report footer-it gives me the last amount of that column and not the sum of the column or the total sum of all the subtotals for the grand total.

WhilePrintingRecords;
Global NumberVar GrpBal;

What am I not doing? Thanks in advance for any help you can give.
 
Your group footer formula should be:

WhilePrintingRecords;
Global NumberVar Duedate;

To get a grand total, you should change your detail formula to:

WhilePrintingRecords;
Global NumberVar Duedate;
numbervar grtot := grtot + {@Cost Balance};
Duedate := Duedate + {@Cost Balance};

Then add a formula in the report footer to display the grand total:

whileprintingrecords;
numbervar grtot;

You don't have to specify "global" as this is the default.

I'm also assuming that the content of {@Cost Balance} required the use of variables for summarizing--that you couldn't just right click on {@Cost Balance} and insert summaries at the group and grand total levels. You should in the future show the content of any nested formulas.

-LB
 
Thank you lbass! That worked!! And you are right in your assumption and I will display them from now on!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top