Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7271 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.