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.

GetNthRecord calculation changes based on sort order

Featured Replies

I have a couple of issues with the attached "mock" database and hoping to get some resolution here. I have aerial survey data. Surveys are conducted each day and each day several legs are flown (one to many relationship). Legs can be "on effort" or "off effort" and the duration of the leg is the time between the next leg timestamp and the current leg timestamp unless its the last leg of the day. A timestamp is created whenever the leg effort status changes (each new record). My objective is to total the amount of time flown "on effort" and "off effort" separately for each survey day (sub-summary when sorted by Survey day). Sometimes survey data are imported from another iPad so the unique serial fields (record numbers) may not be in chronological order.  Since the GetNthRecord function is dependent on the sort order, the values aren't always the same. Other issues I am having are dealing with time and timestamp formats when using calculations, I can't seem to get them to look right.

Clear as mud? Any assistance would be appreciated.

GetNthRecordCalculationProblem.fmp12

This is a case where you probably want to script the creation of the legs and surveys so that you have full control and can can calculate and set the values properly on each record instead of relying on calculations.

  • Author

Would you mind providing a suggestion on how the script would work, especially for the "value setting" portion?

Thanks!

"Sometimes survey data are imported from another iPad so the unique serial fields (record numbers) may not be in chronological order."

However, all of them DO correctly show their parent SurveyID?

I see that your report is sorted STRICTLY by date and is NOT grouped by SurveyID. Is this correct?

Seems doubtful. You only care about the time sequence of the survey legs, independent of what actual survey they are associated with?

Doubtfulness amplified by the fact that you do show a portal based strictly on survey ID.

I don't see any need for GetNth at all.

SurveyFlights.fmp12

Edited by BruceR

  • Author

Wow, I'm always amazed how you guys figure this stuff out with the simplest solution, this is great, and I truly appreciate you attaching an example file, which makes it easier for me to wrap my head around it.

 

 

Edited by Ziphius
Found error on my part, solution working great.

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.