### Title

Calculation in a sub-summary

### Post

I have two fields in a sub-summary, both of which are totals of a similar field in the body. (e.g. Hours Available & Total Hours Available, and Hours Worked & Total Hours worked) I want to divide one by the other in the sub-summary to get a percentage (e.g. Total Hours worked ÷Total Hours Available = % Worked). That calculation returns the same value for each sub-summary and appears to using be the total of all the records, not just the sub-summary numbers.

Any advice on how to do this calculation?

Thanks

In your sub summary layout part, you have to select a field as the "when sorted by" field--which is also known as the "break" field. You can use the summary fields with this break field in getSummary functions to compute a value consistant with the values shown in your summary fields when placed in the sub summary layout part:

GetSummary ( Total Hours worked ; Break Field ) / GetSummary ( Total Hours Available ; Break Field )

Just like your sub summary layout part, the results depend on your sort order and current found set of records.