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

Need to get the Average Discount % of the Order 2

Status
Not open for further replies.

thi123

Programmer
Mar 26, 2004
18
US
I am trying to calculate the Average Discount % of an Order using the Group result but I was not getting the correct figure. I got the correct figure on the details section using this formula:
OrdAmt-NetAmt/OrdAmt = AveDisc %

Appying this formula on the Group result figure below, I should have gotten a 16.7 % (OrdAmt - NetAmt / OrdAmt)

Structure of my report:
Loc3 OrdAmt NetAmt AveDisc %
1 3000 2500 3000.00%
2 6000 4500 ?

Am I using the wrong formula? Can someone help me with the correct calculation? Please help me...
 
Are you using the Sum function for all the elements of your group calculation?

MrBill
 
Mr BillSC,

Yes I am using the Sum function for all the elements of my group calculation.

sample:

Sum ({@OrdAmt}, {Order.OrdNo})-Sum ({NetAmt}, {Order.ordNo})/Sum ({@OrdAmt}, {Order.OrdNo})

Thanks for all quick reply.
 
synapsevampire,

Thank you so much. Your formula works. I have now the correct values on my report.

You guys are great!!!!
 
Another way to make your formula work is to use the % function:

(Sum ({@OrdAmt}, {Order.OrdNo})-
Sum ({NetAmt}, {Order.ordNo})) %
Sum ({@OrdAmt}, {Order.OrdNo})

MrBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top