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

sum of a sum 1

Status
Not open for further replies.

atarrqis

IS-IT--Management
Nov 26, 2004
155
US
CR 8.5 against Oracle

I have 2 goups - Buyer & order_line

At the order_line_del header I have 3 formulas:
QL = {QTY_DUE}-Sum ({QTY_ARRIVED}, {@order_line})+Sum ({QTY_RETURNED}, {@order_line})

15 = if {DELIVERY_DATE} in (today - 15) to today
then {@qty_late} * {UNIT_PRICE}
else 0

45 = if {DELIVERY_DATE} in (today - 45) to (today - 16)
then {@qty_late} * {UNIT_PRICE}
else 0

I need to sum the formulas QL, 15 & 45 for each Buyer group. I can do a Running Total on QL but cannot do this for 15 & 45. I also cannot do a summary on 15 & 45. Appreciate your help on a solution.


 
If these formulas are all working correctly at the order line group level, then you can collect them in variables, using the following formulas:

//{@reset} to be placed in the Buyer GH:
whileprintingrecords;
numbervar sumql := 0;
numbervar sum15 := 0;
numbervar sum45 := 0;

//{@accum} to be placed in the order line group header or footer:
whileprintingrecords;
numbervar sumql :+ sumql + {@QL};
numbervar sum15 := sum15 + {@15};
numbervar sum45 := sum45 + {@45};

//{@displsumql} to be placed in the buyer GF:
whileprintingrecords;
numbervar sumql;

//{@displsum15}to be placed in the buyer GF:
whileprintingrecords;
numbervar sum15;

//{@displsum45}to be placed in the buyer GF:
whileprintingrecords;
numbervar sum45;

-LB
 
PS. If you have group headers repeated on each page, then the reset formula should look like:

whileprintingrecords;
numbervar sumql;
numbervar sum15;
numbervar sum45;

if not inrepeatedgroupheader then
(
sumq1 := 0;
sum15 := 0;
sum45 := 0;
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top