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

Help with subtotals on maximum of a group

Status
Not open for further replies.

AcctSolver

Technical User
Sep 27, 2003
28
US
I have a report that uses data from two tables containing header data, with a linking table containing detail data used solely to create the relationship between the two header tables. Call one CustomerInvoiceHeader, the second CustomerOrderHeader, and the third LinkOrderInvoice.
I need one line for each customer invoice, which shows the invoice total and customer order#.
The InvoiceHeader table has the Invoice number and invoice total. The CustomerOrderHeader table contains the customer order number. The LinkOrderInvoice table links the invoice on one side, and the order on the other. But the LinkOrderInvoice table has a line for each detail line of the invoice. So, if there are four lines on the invoice, and the total invoice value from the invoice header table is $200, I wind up with $200 four times. I grouped on invoice number, and took a maximum of all the fields, then suppressed the detail. Great. Now I want to be able to get a total of the invoices for each customer in that report. You can't create a subtotal on a maximum. Any idea how I can get that? I tried a running total, but that did not work. I would welcome ideas on another approach - I am SURE this has happened to someone else.
 
To achieve 1 line per invoice, move everything from the detail line to the Group Footer and suppress the details (and GH). If you need a total of the invoices at the end of the report, use a running total:

Sum: Invoice Amt;
Evaluate: On change of Group (Inv #)
Reset: Never

Cheers
Pete
 
Just realisd you want a total for each customer. To achieve that, and assuming Customer is a higher level group, add a running total, same as above, but Reset on change of group (Customer).

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top