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.

Simple calculation field does not work

Featured Replies

I have attached a simplified file with a calculated field that does not work. The calculated field is:

Case (LeftWords (DISPOSITION;1 = "DIED") or LeftWords (DISPOSITION;1 = "EUTHANIZED") and IsEmpty(DATE OF DEATH); "DATE OF DEATH NOT ENTERED")

I want the warning displayed if the disposition is either "DIED" or "EUTHANIZED" and the DATE OF DEATH field is empty.

Thanks in advance.

Untitled.fp7.zip

Don't have to be that complicated.

If ( DISPOSITION = "DIED" or DISPOSITION = "EUTHANIZED" and IsEmpty ( DATE OF DEATH ); "DATE OF DEATH NOT ENTERED" ; "" )

What was your reasoning behind the choice of leftwords?

 

Edited by Kris M

Don't have to be that complicated.

​Indeed, but one should still observe operator precedence:

Case (
  ( disposition = "died" or disposition = "euthanized" )
  and
  IsEmpty ( dateOfDeath ) ;
  "Date of death not entered"
)

Case (LeftWords (DISPOSITION;1 = "DIED") or LeftWords (DISPOSITION;1 = "EUTHANIZED") and IsEmpty(DATE OF DEATH); "DATE OF DEATH NOT ENTERED")

Problem #1:

LeftWords (DISPOSITION;1 = "DIED")

That's bad syntax. It should have been:

LeftWords (DISPOSITION;1)= "DIED"

The way you have it, it evaluates 1 = "DIED" first. This returns 0, and that's the number of words the LeftWords() function will return.

 

Problem #2:

AND is evaluated before OR. The way you have it (after fixing problem #1) will return the warning if the field begins with "DIED", regardless of the date being empty or not.

 

Problem #3:

The result type of the calculation should be Text.

 

If ( DISPOSITION = "DIED" or DISPOSITION = "EUTHANIZED" and IsEmpty ( DATE OF DEATH ); "DATE OF DEATH NOT ENTERED" ; "" )

Problem #2: - see above.

BTW, an empty default result is entirely redundant.

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.