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

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

Recommended Posts

Posted

I would like to report average age for male and female in a class in a school.

I would like to see the numbers side by side in a report showing stats for school, sub stats for class. But the average function is not accurate because it is summing all the students.

I unterstand that I could run a gender sort first but that would duplicate the report and make it visual hard to see male vs femail data.

Posted

You will need four calculated fields:

IsMale:

=(Gender="m")

IsFemale:

=(Gender="f")

MaleAge:

=StudentAge * IsMale

FemaleAge

=StudentAge * IsFemale

Then create two weighted average summary fields:

FemaleAverageAge:

Average of FemaleAge weighted by IsFemale

MaleAverageAge:

Average of MaleAge weighted by IsMale

  • 2 weeks later...
Posted

The IsFemale and IsMale were not available for use in the weighted area. However, MaleAge and FemaleAge were and seem to work as you thought they other should.

Lee confused.gif

Posted

It will work as long as the calc field results are defined as number.

IsMale and IsFemale are logical calculations with a result of 0 or 1.

Looking back on this now though, I see that I did make it more complicated than necessary. You don't need the FemaleAge or MaleAge calculated fields at all. You just define the summary fields as:

FemaleAverageAge:

Average of Age weighted by IsFemale

MaleAverageAge:

Average of Age weighted by IsMale

Posted

smile.gif

> It will work as long as the calc field results are defined as number.

>

> IsMale and IsFemale are logical calculations with a result of 0 or 1.

I had these with a result = text, changing them to = number did the trick.

>

> Looking back on this now though, I see that I did make it more complicated

> than necessary. You don't need the FemaleAge or MaleAge calculated fields at

> all. You just define the summary fields as:

Yep, changing the calculations now allows the access to IsFemale and IsMale.

>

> FemaleAverageAge:

> Average of Age weighted by IsFemale

> MaleAverageAge:

> Average of Age weighted by IsMale

Assuming a typo here, Age should be StudentAge in keeping with the original calculations.

Thank you Bob, I appreciate your sharing this with us.

Lee

smile.gif

This topic is 7941 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.