comment Posted December 26, 2004 Posted December 26, 2004 Could someone please explain the difference between a summary field average and a calculated one? Here is a file showing an interesting discrepancy between tho two. averages.zip
Søren Dyhr Posted December 26, 2004 Posted December 26, 2004 They observe the typecast of the "n/a" value differently ...you need to Abs(Choise) to get rid of the third value ...and both behave equal! --sd
comment Posted December 26, 2004 Author Posted December 26, 2004 I believe that Average = Sum/Count. Count, according to FMP help, is "the number of valid, non-blank values". IMHO, a text entry in a number field is NOT a valid value. Therefore, the Summary Average is correct in ignoring it, and the Average function is wrong in counting it. (However, the Summary Count does count it, as does the Count function. So it appears that in a summary field Average <> Sum/Count. The new attached file shows this very clearly.) Using Abs() is essentially validating the non-valid value. So of course it appears to "solve" the problem, but in fact it is merely ignoring it. As it happens, I would like to get the CORRECT average across a relationship. averages2.zip
Søren Dyhr Posted December 26, 2004 Posted December 26, 2004 Using Abs() is essentially validating the non-valid value. So of course it appears to "solve" the problem, but in fact it is merely ignoring it. Yes I had my doubt of which was which, but had to think it through... --sd
comment Posted December 26, 2004 Author Posted December 26, 2004 Here the plot thickens... (see file no.3) It seems that ABS(x) achieves the same as = x (result number), but NOT the same as GetAsNumber(x). I find this somewhat ridiculous. averages.zip
Søren Dyhr Posted December 27, 2004 Posted December 27, 2004 Yes it's obvious that ChoiceAsN which behaves correctly ...but no it isn't ridiculous it's an ever ongoing debate on Empty, zero and void ...the issue when looping choosing between IsEmpty or "" for the scripts progressing. It's simply the machine implementation of math-rules in the inner mechanics. It's our duty to gain knowledge of such discrepancies, in order to pick the best of decent solutions. Another option that behaves as supposed to is: Filter ( Choice ; "1234567890" ) But Average over a relation is always tricky since it isn't obvious which number of records to count as well as summing. Is it the ones with something entered or all dispite value even void... So I would think that we have learned is - when Avarageing over a relation must this precaution be made: Average ( All::ChoiceAsN ) where ChoseAsN = GetAsNumber ( Choice ) or Filter ( Choice ; "1234567890" ) --sd
comment Posted December 27, 2004 Author Posted December 27, 2004 It's our duty to gain knowledge of such discrepancies I agree. Therefore the following is purely a philosophical observation (or bitching, if you like) The fact that Summary Average counts differently than Summary Count is ridiculous. In fact I would say that is a bug; The fact that [numberfield] <> [calculation, number = numberfield] is also ridiculous. So I would think that we have learned is - when Avarageing over a relation must this precaution be made: Average ( All::ChoiceAsN ) where ChoseAsN = GetAsNumber ( Choice ) or Filter ( Choice ; "1234567890" ) I would say we have learned more than that: When averaging, you have a choice to count non-valid values or not; you also have a choice of averaging over a relation or in a Summary field. I believe my last file shows how to handle each of the 4 possible combinations.
Recommended Posts
This topic is 7271 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now