Board index » delphi » MATH GURU's - I need some help with an AVERAGE problem

MATH GURU's - I need some help with an AVERAGE problem

I'm trying to accurately compute an Average Gross Profit Margin on a
list of transactions. I have about 200K of records and I want to
compute what each company's average profit margin is based on these
sales. I have the number of items sold, cost of each item, price each
item was sold for.

Each company has about 1000 records in my database.

How can I compute this Average Gross Profit Margin for all the sales?

Bill Artemik
--------------------
Programmer / Analyst
Wakefield Engineering, Inc.

barte...@wakefield.com

"There are THREE kinds of people in the world...
     Those that can count and those that can't."

 

Re:MATH GURU's - I need some help with an AVERAGE problem


The "proper" way to do this is to count the number of transactions for
each company, while you aggregate the cost and sale.  Then divide the
cost and sale totals by the count, to arrive at the Mean Cost and Mean
Sale.  Mean Sale - Mean Cost = Mean Margin.  Mean Margin / Mean Cost *
100 = Mean Gross Profit Percent.

However, this is a case where you can achieve the same result by using
the aggregates, without the extra step of determining the Mean Cost and
Mean Sale.  (Aggregate Sale - Aggregate Cost) / Aggregate Cost * 100 =
Mean Gross Profit Percent.

You need to be sure to multiply the result of the division by 100 in
order to get a percentage display to make sense.  If the result is 9%,
it will display as .09 after the division.  Multiplying by 100 will make
it display as 9, which is easier for your bean counters to handle.

HTH,

!^NavFont02F02A30007IGHHIA4F1EA

--
 - George E. Waldron  at 06/05/98, 09:21
   Computers, by George!
   Naples, FL
   Using OUI 1.8 Pro
   See Weather or Not at http://members.xoom.com/edwaldron/

Other Threads