I know I should have paid better attention in math classes...

I have a table of part numbers and their respective count and average
revenues over a 5 year span, such as:

Count1  Count2  Count3  Count4  Count5     Avg1       Avg2       Avg3
Avg4        Avg5
8                 0              15                2              0
100            0               75             125             0


I want to add 2 columns to my temporary table (for reporting) showing the
total number of serviced items (total count, no problem), and,
the average service dollars (my challenge). 

Therefore, the number of AVG columns > 0, in this case, 3 as a divisor with
the sum of averages as the dividend (100+75+125=400). So, my quotient would
be 400 divided by 3 = 133 and change.

As all the averaging for these rows of numbers is part of my nightly
maintenance (re-populating a table with a revolving 5 year history of data),
I really don't want to sum service dollars again in performing this task,
though this method would yield the results I want. Just that the performance
would really be slow. Rather, I'd like to do the above, but, am failing to
come up with the math or function to do so in creating my "Average" columns
for years 1 thru 5. Any ideas appreciated!

Brad Davidson

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: 
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, 
place any 
text to search for.
================================================


Reply via email to