February 11, 200322 yr 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.
February 12, 200322 yr 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
February 20, 200322 yr 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
February 20, 200322 yr 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
February 20, 200322 yr > 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
Create an account or sign in to comment