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.

Calculation based on previous record

Featured Replies

  • Newbies

I am new to the forum and I am trying to set up a calculation where I enter the current hour meter reading and it will display the hours run since the last record's current reading.

How can I reference the previous record's entry?

Thanks

Nverted

[Read the last bit first]

I think there might be a built in function for this but I experimented to see if a relationship would work. It does. You need two calculation fields, result Number:

RecID :)

Get ( RecordID )

and PrevRecID :)

Get ( RecordID ) - 1

and then just create a relationship based on those two (I got it the wrong way round at first). As record IDs are allocated in record creation order then this would give you access to all the fields in the previous record. If you replace the - 1 with a '- ' it could make the data to any previous record available in the current record.

What happens if the previous record got deleted?

What happens if the previous record is blank?

Experimented some more and there is an easier way without the need to create a relationship. Just use this:

Prev Reading :)

GetNthRecord ( Meter Reading; Get ( RecordID ) - 1)

I'd read about GetNthRecord but didn't understand it till your question got me to use it. Thanks,

Norman

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.