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.

tricky date calculation

Featured Replies

  • Newbies

I am a doctor and working on a research project. I have patients who have a lab value measured several times a day. If the value is above a certain level, we start a medication and we adjust the dosage several times a day. I record the lab value in LabValues:value and the time when the lab value was measured in LabValues:timestamp. I record the medication dosage in Medication:dosage and the time when the medication dosage was adjusted in Medication:timestamp. I want to find the last lab value that was recorded before the medication was started and color it red. I cannot figure out the formula to do that. Can anybody help?

Thanks

Andreas

(Using FM11 on a Mac)

This part is not quite clear:

I want to find the last lab value that was recorded before the medication was started and color it red.

The "last lab value" is different for each change of dosage, isn't it? So where exactly do you want to find it? You could, if you wanted, link each dosage to its own "last lab value" using a relationship.

  • Author
  • Newbies

No, that's part of the problem. The lab values get measured independently of the dosage changes. So I want to find the lab value that triggered the first dosage change (i.e. starting the medication). That would be the lab value that was measured just before or right at the time of the first dosage change. I tried the following formula to conditionally format the LabValues:value field:

If ( LabValues::Timestamp <= Min ( Medication::Timestamp ) ; 1 ; 0 )

This allows me to color all lab values that were measured up to the time when the medication was started, but I only want to color the very last value that was measured before the medication was started.

Hope this is more clear. Thanks for your help!

Andreas

I see (the word "find" has a specific meaning in Filemaker, so that was a bit confusing). Anyway, how about this way?

LastLab.zip

  • Author
  • Newbies

That works.

Thanks a lot!

Andreas

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.