### Title

Brain fried - simple(?) calculations for a dog show

### Post

Hi- Noob back again. I think these are simple, but I am having no luck. My brain is just fried from being at a computer for 5 days straight. I want to create two basic calculations.

In the first example, I have a field called height in cm in one table (evaluations). In a second related table (entry info), I have fields for sex (Dog/Bitch) and an entry type field (puppy /adult). I want to get an average of the height for all dogs that are male, excluding puppy, then also do the same for females, excluding puppy. So each calculation formula should produce a single #, the average height for all the males, etc. I have 6 measurements to do this for, but once I know the formula, I should be good.

Second example, I need to do a count of the number of fields that meet two criteria. For example, for coat quality I have 4 possible ratings, EX, VG, G, F. I need to know how many males recived an EX, How many VG, etc, and the same for females. I can include puppies in this set. Here I have 43 qualities to count for each sex, but once I know the formula, I can adapt. In this case, ratings are in my evaluations table, the other info is in my entry info table. The two tables are related by entry #, a field I won't be using, of course, if that matters.

I know this is simple (or at least I hope), but I have gotten nowhere. I've never worked with scripts, so haven't even looked if there is a simple way to do all the calculations at once.

Thanks so much for any help - I'm missing something obvious, I know. If I had more time / less deadline, I might be able to figure it out!

You have two options for computing an average drawn from a group of records.

To count how many "EX" ratings, use a calcualtion like this: (CoatQuality = "EX") + (Conformation = "EX") + .....

CoatQuality = "EX" returns 1 if this is true and 0 if it is not so adding these expressions together will count the number of fields that were rated "EX".

Note: Given the number of such ratings, it might simplify your system to put each rating in a related table instead of using so many dedicated fields. Your table might be structured like this:

entry #

RatingCategory

Rating

ExFlag : Rating = "EX"

Then Sum ( RatingsTable::ExFlag ) would count the number of EX ratings a dog would receive.