Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3533 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted (edited)

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
Posted

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"
)

Posted

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.

 

Posted

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.

This topic is 3533 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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