Page 1 of 1

Trying to average

Posted: Fri Feb 16, 2007 5:23 pm
by FRED_EMMERICH_(Guest)
I have 2 tables linked, a master and slave, a one to many. The many table is date oriented with monthly values. What I want to do is create an average of the first 2 months of data for each entity in the master table, regardless of how many dates there are total. I tried doing a conditional total (average) and using a counter on the dates, but it would not let me base a condition on a total field. Then I tried to do it by creating a calculated field that is equal to the value for that month if it is month 1 or 2, zero otherwise. I get an average but it includes all the months of zeroes, so the answer is wrong.____Any ideas?____thanks__Fred EMmerich

=> RE: Trying to average

Posted: Fri Feb 16, 2007 7:22 pm
by BitcoinplaYLET
__Fred, how about showing us your present code for computing the average. If I understand you correctly, the average is being computed as:__ The sum of months 1 & 2 values divided __ by the total number of months (instead of 2).____Often a fresh pair of eyes will spot the problem quickly, so show us what you are doing specifically. Thanks.

=> RE: Trying to average

Posted: Mon Feb 19, 2007 2:23 pm
by kfleming
Try returning BLANKNUM() instead of 0. BLANKNUM records will not contribute to the average.____Kathleen__R&R Support