Newbies sonflare Posted May 22, 2008 Newbies Posted May 22, 2008 I have a related number field, which sometimes contains "<" on front of the number, due to it being a scientific test value. ie. They can't test for the existence of something below a certain threshold so it gets called "<0.1" instead of "0". I am trying to get an average of this field via a batch relationship. Only trouble is that the "<" seems to be upsetting the Average function. I've tried this: Average ( If ( Left ( RelatedTable::RelatedField ; 1 ) ="<" ; 0 ; RelatedTable::RelatedField ) ) to try and make the "<0.1" translate into "0" but the Average function is just drawing a blank (empty). If I leave the value as "<0.1" then the average treats it as 0.1, which is technically incorrect. Any ideas on how I can overcome this problem?
comment Posted May 22, 2008 Posted May 22, 2008 You cannot put conditions INSIDE the Average() function. I would make the field a Text field (since it allows entries which are not numbers), and add a calculation field with a Number result that would return 0 for entries like "<0.1", otherwise the entered number. Then average the calculation field instead.
Newbies sonflare Posted May 22, 2008 Author Newbies Posted May 22, 2008 Bummer I was hoping that would not be the answer. There are a LOT of these result numbers that need to be averaged... Oh well.
comment Posted May 22, 2008 Posted May 22, 2008 Do you mean you have a lot of different FIELDS like that? If there's not too many related records, you could use a custom function instead - but you would need the Advanced version. Hmm.. How about something like this: CleanAverage.fp7.zip
Newbies sonflare Posted May 22, 2008 Author Newbies Posted May 22, 2008 Hey, wow! That looks like my answer. Thanks heaps. I'm not all that advanced when it comes to calculations, but I see how that works. I could turn it into a custom function as I do have FMP Advanced. Thanks again.
Lee Smith Posted May 22, 2008 Posted May 22, 2008 I could turn it into a custom function as I do have FMP Advanced. Update your Profile, so that we know how to answer your questions. Main Menu [color:blue]>> MY PROFILE [color:blue]>> Control Panel [color:blue]>> FileMaker Questions Lee
Recommended Posts
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