rivet Posted February 11, 2003 Posted February 11, 2003 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.
BobWeaver Posted February 12, 2003 Posted February 12, 2003 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
rivet Posted February 20, 2003 Author Posted February 20, 2003 thanks Bob you just saved me from created some sad looking reports.
Lee Smith Posted February 20, 2003 Posted February 20, 2003 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
BobWeaver Posted February 20, 2003 Posted February 20, 2003 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
Lee Smith Posted February 20, 2003 Posted February 20, 2003 > 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
BobWeaver Posted February 20, 2003 Posted February 20, 2003 Yes it was a typo. Age should be StudentAge.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now