2 Replies Latest reply on Jan 31, 2012 9:06 AM by KOerton

# Calculating % of total

### Title

Calculating % of total

### Post

Hi,

I'm new to FMP and I'm trying to figure out how to add a field that calculates % of total, where the total is based on a subset of records within the table.

I have a table with following records:

Themes Table

Theme Name

Theme Ratio

Theme Ratio %

The "Theme Ratio %" field should calculate "Theme Ratio" / Sum of all "Theme Ratio" records with the same "Theme Name".

E.g.

Red, 60, 30%

Red, 40, 20%

Red, 100, 50%

Yellow, 10, 20%

Yellow, 40, 80%

Thanks,

Kevin

• ###### 1. Re: Calculating % of total

Define a summary field, sTotalTheme as the total of Theme Ratio.

Define this calculation field, cRatioPct:

Theme Ratio / getSummary ( sTotalTheme ; Theme Name )

Use data formatting in the inspector to format cRatioPct as a percent.

Then be sure to sort your records by theme name or this will not work.

• ###### 2. Re: Calculating % of total

Works like a charm!  Thanks Phil :)