Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dividing two summary fields in a subsummary report

Featured Replies

I have 2 fields: Year (number), Skunks (Text: yes or no). I want to calculate the ratio of #skunks per year.

I created the following summary field:

sCountYear = sCount(Year) when sorted by Year

sCountSkunks = sCount(Skunks) when sorted by Year

I create a subsummary part when sorted by year to calculate the number of surveys done per year, and the number of skunks (no sightings) occurred each year. I need a summary field that will calculate the proportion of skunks per year for each year (sCountYear/sCountSkunks), but I can't make a summary field perform a calculation, and a calculation field isn't going to give me subsummary values by year, only a trailing grand summary.

This must be really simple to do but I can't figure it out. Any help would be greatly appreciated.

To perform a calculation using sub-summary values, you need to use the GetSummary() function.

Note. however, that a summary field will count all non-empty fields - so if your field contains either yes or no, all records will be counted alike. If, OTOH, you were using 1 for Yes, 0 (or empty) for No in a Number field, you could divide the sum of the field by the count to get the ratio.

  • Author

Correct, I oversimplified my example. The skunk field is actually a calculation field that sets a 1 if no sightings occurred and a 0 if at least one sighting occurred. The summary field is then a total of the skunk field as you have shown, not a count field.

When I use the GetSummary function I can do:

GetSummary (sTotalSkunks; cYear )

or

GetSummary (sCountYear; cYear )

but what I want is:

GetSummary (sTotalSkunks / sCountYear; cYear )

but I get the error: "Only summary fields are allowed as the first argument in a GetSummary function".

Try =

GetSummary ( sTotalSkunks ; cYear ) / GetSummary ( sCountYear ; cYear )

You'll probably want to subtract that from 1, due to 0 being positive in your system.

Note that the counting summary field can count any field that cannot be empty, and neither of the two summary fields needs to be running or restarting.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.