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.

Identify current records in a single table

Featured Replies

Hi Folks,

I have a table containing information about climate sensors I manage. I need to determine the most recent record for all sensors by serial number according to the most recent calibration date for that specific sensor and then set that sensor's status to "Current".

I currently have a script that sorts the table by serial # and calibration date and then does a row-wise comparison to determine if two adjacent records are the same. From this result I then create a new variable called Current Status. The script seems overly cumbersome and time consuming and I'm thinking there is a more cleaver and less computational intensive way to figure this out. Thanks.

I currently have a script that sorts the table by serial # and calibration date and then does a row-wise comparison to determine if two adjacent records are the same.

Why same? Do you have duplicate records? Is your sensor information in one table and your calibration in another related by sensor id?

  • Author

I have multiple entries for a given sensor by serial # based on the date it was installed or removed from a particular location. The table looks like this.

Serial # Date Removd/Instald Calib Date Status

Q488 5/15/05 6/1/05

Q488 6/15/07 7/21/07 Current

Q489 5/12/03 5/19/03

Q489 4/20/05 5/1/05

Q489 9/23/06 10/1/06 Current

R064 6/1/04

R064 7/2/05

R064 8/3/06 8/15/06 Current

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.