4 Replies Latest reply on Oct 14, 2014 1:46 PM by NonProfitEducationUser

Getting a percent in a report subsummary field

Title

Getting a percent in a report subsummary field

Post

Hi,

I am having trouble with creating a percent of a total in subsummary fields. I am trying to calculate the percent of male and female attendees based on a total of the attendees in their county.  All fields are in the same table occurrence.

I tried following the example found here but I'm not really sure how to change it to fit my situation:

But I am getting blanks as was mentioned. I have the field in a subsummary section of a report. (I have no issues with the grand summary- I use a calculation field there).

I am using this calculation:

(GetSummary ( CoSumMales ; CoCounty)) / (GetSummary ( CoSumGenders; CoCounty))

Where CoSumMales is a summary field of males. And CoCounty refers to the cohorts county. CoSumGenders is a summary of all the males + females.

The report is sorted by educator, and then by county. (Even when I just sort by county, the calculation still isn't working).

I am looking for a report that would look like this:

Teacher A Name

County A              total number of participants                  %male   %female

County B              total number of participants                  %male   %female

Teacher B Name

County C              total number of participants                  %male   %female

County D              total number of participants                  %male   %female

GRAND TOTAL     total participants   %male %female.

The totals and the grant totals work fine; I just can't get a % for each gender based on the county.

I know how to make a number (like .6) in to a percent for the report, I just don't know how to get FM to return that first number for me.

• 1. Re: Getting a percent in a report subsummary field

If you replace the calculation fields that aren't working with the three "coSum..." summary fields, do they show the correct counts in each sub summary part?

• 2. Re: Getting a percent in a report subsummary field

They show grand totals and not the subsummary totals.

• 3. Re: Getting a percent in a report subsummary field

And that would explain why getSummary is not returning the expected values.

What is the "sorted by field that you are using" for that sub summary layout part? If it were CoCounty, I would not expect to see grand totals when the summary fields are then placed inside the sub summary layout parts.

Once your summary fields correctly show the needed sub totals when placed inside a sub summary layout part, the getSummary function should then work to produce the desired percent.

• 4. Re: Getting a percent in a report subsummary field

I misunderstood. The "CoSum" fields do show the correct counts. But my calculations still aren't working. I'm sure it's something to do with my syntax.

Here is the full calculation that I would LIKE to use (I've been trying with just the middle portion and it's not working, but I'd eventually like to be in a full percentage form. This formula- without GetSummary works fine in the grand totals.):

Round (((GetSummary (CoSumMales ; CoCounty)) / (GetSummary ( CoSumGenders; CoCounty)) * 100); 1)

My found set is sorted FIRST by CoLead, THEN by CoCounty.

I tried even putting in CoLead in for county and still not getting a result. Then I tried just sorting by county, and it's still not working. Do I have my order for the GetSummary correct? First the field you want subtotaled, then the field that it will be sorted by, correct?

Thanks for your help with this.