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

Summarize Running Total and Formulas 1

Status
Not open for further replies.

Dominican1979

IS-IT--Management
Apr 30, 2008
108
US
I'm creating a commissions report for sales reps at the company I work for. I need to be able to summarize a running total at the end as well as formulas derived from the running total. Here’s what I have so far:
CustNo, Name, GroupNo, NetInvoiced, GroupDiscount, CommissionBase, Commission
I created a group on CustNo, and placed all the fields and formulas above in the group footer to display summarized data for each customer. This all works fine, However I need to show a grand total at the end of the report for each summary field above. I tried just adding the same formulas on the report footer, but shows me whatever the last summary record was. Here’s how I break down my calculations:
NetInvoiced = Running total field
GroupDiscount = NetInvoiced * 0.1 (depends on the GroupNo)
CommissionBase = NetInvoiced – GroupDiscount
Commission = Commission Base * CommissionRate (comes from the sales rep table)
Your help will be greatly appreciated, thank you!
 
There's not really enough detail here to be very specific. Are you certain you need to use running totals in the first place? Have you tried adding new running totals that have no reset to get report level results? If you must use running totals, and if you need to add results, then you could use variables, as in:

//{@accum} to be placed in the group footer:
whileprintingrecords;
numbervar x := x + {#yourrt};

Then in the report footer, use the following to display the results:
whileprintingrecords;
numbervar x;

-LB
 
Hi lbass,

Thanks a lot for your reply. Basically the running total field NetInvoiced evaluates every record and resets on change of group and the group is on CustNo. I don't know how else to summarize all the transactions for each customer other than using a running total and then placing the field in the group footer. Below is some brief sample data to see if it makes more sense what I want to accomplish.

CustNo NetInvoiced GroupDiscount CommBase Commission
200250 464.85 46.49 418.37 66.94
200286 64.95 6.50 58.46 9.35
etc...

Then on the report footer I want to have a summary for all the customers together like this:

NetInvTotal GrpDiscTotal CommBaseTotal CommTotal
529.80 52.99 476.83 76.29


and like I said before the NetInvoiced is a running total the rest of the fields are formulas based on the running total for each group, I dont' now how to summarize either of them the running total or the formulas on the report footer. Thanks a lot for your help again.




 
Instead of using running totals, it sounds like you could just right click on the detail field you want summarized->insert summary->sum->group level and/or report level.

-LB
 
Hi lbass, thanks a lot for your help. I picked the first option doing the Whileprintingrecords to accumulate the values. I tried your second suggestion, but couldn't do the right click and add a summary to formula fields. Works great!
 
You can insert summaries on formulas that do not use "whileprintingrecords" and which do not contain summaries themselves or functions based on a sequence of records like next() or previous().

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top