Jump 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.

Struggling with OnTime Calculation for Summary

Featured Replies

  • Newbies

I'm obviously brain dead today (and the past week). This has got to be a very simple calculation, but I just can't see it at the moment.

On each record I have:

a field "OnTime" that displays either "Yes" or "No"

On the summary in preview after sorting by customer:

a summary field that counts the number of "OnTime" fields and displays in the customer summary as "Flights"

Here is my problem: I want a field that simply calculates the number of "Flights" that were "OnTime" and display as a percentage.

Answer=On Time Flights/Total Number of Flights.

If I had 9 flights total and 4 were ontime, it would be x=4/9 or x=.44

I'm trying to write a calculation that will, after sorting by each customer, divide the number of "Yes" OnTime flights by the Total number of Flights the customer had.

The goal is to have a field that displays a percentage. On each customers summary it might have something like, Flights:50 OnTime:90%

(That would be x=45/50 and the answer displayed as a percentage.)

Does this make sense because I'm struggling with this. It's got to be easy, but I'm just not seeing it and would really appreciate a shove in the right direction. Thanking all in advance.

First of all, since your OnTime field seems to only hold a "Yes" or a "No", I would suggest making it a number field, and using the number 1 (true) to mean the flight was on time, and either 0 or empty (false) to mean the flight was not on time.

With this setup, the calculation becomes simple. Make a new calculation field in your customer file. Have the calculation be


sum( Flights::OnTime ) / Count( Flights::ID )

Put the field on your layout in a sub-summary when sorted by the Customer ID, and format it to appear as a percentage.

On each record I have:

a field "OnTime" that displays either "Yes" or "No"

On the summary in preview after sorting by customer:

a summary field that counts the number of "OnTime" fields and displays in the customer summary as "Flights"

This part doesn't make sense. A summary field counts all non-empty values; if the field contains either "Yes" or "No", all records will be counted. Perhaps you are sorting by customer AND by OnTime?

I'm trying to write a calculation that will, after sorting by each customer, divide the number of "Yes" OnTime flights by the Total number of Flights the customer had.

You can define a summary field as fraction of total.

  • Author
  • Newbies

Thank you to both who replied. Having looked at both responses, I did change from a "Yes" "No" to a "1" "0", and used the Sum calc and got what I needed. In the second response by "comment", my summary field was incorrect. I used the information from both suggestions and I thank you both.

Create an account or sign in to comment

Important Information

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

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.