Trying to average

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
FRED_EMMERICH_(Guest)
Posts: 170
Joined: Tue Oct 10, 2017 12:44 pm

Trying to average

Post by FRED_EMMERICH_(Guest) » Fri Feb 16, 2007 5:23 pm

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

BitcoinplaYLET
Posts: 0
Joined: Tue May 01, 2018 10:03 pm

=> RE: Trying to average

Post by BitcoinplaYLET » Fri Feb 16, 2007 7:22 pm

__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.

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Trying to average

Post by kfleming » Mon Feb 19, 2007 2:23 pm

Try returning BLANKNUM() instead of 0. BLANKNUM records will not contribute to the average.____Kathleen__R&R Support

Post Reply