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.

evaluate field in previous record

Featured Replies

I am trying to come up with a calculation to incorporate into a script. Basically the calculation has to compare the value of a field in the current record against the value of the same field in the previous record. It seems like there should be a fairly straight forward way to do this, but I'm missing it.

It would be a boolean result. The value is either equal or notequal to the previous value.

Would appreciate some help.

Thanks.

How would you define the previous record? (It changes based on sort order and found set). In the same table or that last one viewed?

You could capture a value in a variable in a navigation script, compare and set a field.

Can you expand on your goal?

Assuming that by "previous record"" you mean whatever record happens to be before the current record, in the current found set, according to the current sort order, you can use the GetNthRecord() function:

Valuefield = GetNthRecord ( Valuefield ; Get ( RecordNumber ) - 1 )

If you are in a script, you can also move to the previous record, put the value in a variable and come back to do the comparison.

  • Author

The previous record would be based on an automated unique identifier serial number. So the comparison would always be

(Value of field(x) in record with UI(y)) = (value of field(x) in record with UI(y-1))

This will be incorporated into a rather complex parsing script. I want the script to skip to the next found value if it encounters a consecutive repeat.

Yes I have it set up to work with a navigation script, but I was wondering if there was a less convoluted way since my script is taking on a life of its own. One calculation to activate an exit loop is my goal.

Thanks

Edited by Guest

  • Author

This calc looks good. I will give it a try.

I am trying to avoid additional script steps, so I would prefer not using go to previous record, but that would work as well as you suggested.

Thanks a lot

The previous record would be based on an automated unique identifier serial number

Then you'll have to either make sure you have the necessary found set, sorted by the serial, or use a relationship to retrieve the value. There's probably a simpler way do whatever you're trying to do.

Edited by Guest

  • Author

The "previous record" in this case is always the chronologically and physically previous record in the same found set.

So the calc Valuefield = GetNthRecord ( Valuefield ; Get ( RecordNumber ) - 1 ) works perfectly and accomplishes exactly what I needed.

Thanks for your help and very rapid replied.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.