7 Replies Latest reply on Mar 20, 2013 8:22 AM by philmodjunk

# Calculate a percentage in a trailing grand summary

### Title

Calculate a percentage in a trailing grand summary

### Post

Calculating the percentage in each sub summary is easy - do get summaries for each break depending on how each subsummary is sorted.

But, since the trailing grand summary isn't sorted, the get summary functions don't work. and, far as I know, you can't use a summary field in a calculation without the get summary function.

So, how would I do this? Thanks for your help!

• ###### 1. Re: Calculate a percentage in a trailing grand summary

Wouldn't the percentage in a trailing grand summary be 100% ?

Or do you want to include a "recap" of all the groups with percentages in the trailing grand summary?

If so, what version of FileMaker are you using?

• ###### 2. Re: Calculate a percentage in a trailing grand summary

Thanks PhilModJunk!

I'm using FMP 12A

I'm converting an excel file and the calculation they have for the total percentage is the Total of A divided by the Total of B.

Thay also have a "recap" of all the groups in the trailing grand summary but for now I'm skipping that and providing that as a separate sorting option.

• ###### 3. Re: Calculate a percentage in a trailing grand summary

I have no idea what "A" and "B" represent.

For the recap issue, Execute SQL can be a useful way to produce that: FMP 12 Tip: Summary Recaps (Portal Subtotals)

• ###### 4. Re: Calculate a percentage in a trailing grand summary

Sorry for the delay in getting back to you, PhilModJunk.

Total A is the Total of Column A and Total B is the total of column B. These are just the summary fields that so nicely added up the data that was in the subsumaries. The Totals are in the Trailing Grand Summary.

In the Excel file I'm copying, they have a Total for Column A and a Tota for Column B. Then they have the percentage with Total B divided by Total A.

I'll take a look at the Execute SQL and see if that will help.

• ###### 5. Re: Calculate a percentage in a trailing grand summary

If you have a summary field for each total, you can use those two fields in a calculation field to compute your percentage.

SummaryFieldforA / SummaryFieldForB

Then format the field on the Inspector's data tab to use a percent format.

• ###### 6. Re: Calculate a percentage in a trailing grand summary

Thank you. I didn't think that would work because you need to do the getsubsummary() and sort by the subsummary part otherwise.

That worked.

• ###### 7. Re: Calculate a percentage in a trailing grand summary

If summary fields are used in a calculation, they return totals based on the current found set. You only need GetSummary for when you need to access a sub total such as you can show in a sub summary part in your calculation.