Jump to content

The "and" operator not working


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

Recommended Posts

Hi

i am trying to product a calculation that would only show an asteric if  field 1 is filled and field 2 is empty.

if field any other combination i don`t want it to show. for some reason it is not working .

see calculation below

field 1 = Ingredeint_Production 3::date

field 2 = Ingredeint_Production 3::Approved

 

( IsEmpty ( Ingredeint_Production 3::Approved ) and  not IsEmpty ( Ingredeint_Production 3::date ) ) or 
IsEmpty ( Ingredeint_Production 3::date )

 

Any idea whee i went wrong and why the first calculation is not working as expected.

i would appreciate some support , thanks in advance.

 

Link to comment
Share on other sites

take control of the order of precedence so that you are not surprised.

You have:

if[ A and not B or C]

do you mean:

if[ (A and not B ) or C]

or do you mean

if[ A and ( not B or C ) ]

or do you mean

if[ A and not (B or C )]

...

 

Link to comment
Share on other sites

i only have A & B

the second statement is beacuae it is in a portal and i don`t want it to show if no record exists. (would achieve this in first statement when i get it right)

i need 

5 minutes ago, Smiley said:

field 1 is filled and field 2 is empty

 

Link to comment
Share on other sites

35 minutes ago, Smiley said:

i am trying to product a calculation that would only show an asteric if  field 1 is filled and field 2 is empty.

If that's what you want, then your calculation should look like this:

If ( IsEmpty ( Field1 ) and  not IsEmpty ( Field2 ) ; "*" )

and nothing else.

The test that you have:

IsEmpty ( Field1 ) and  not IsEmpty ( Field2 )  
or
IsEmpty ( Field2  )

will also return true whenever Field2 is empty, no matter what Field1 contains (or doesn't). Logically, this is equivalent to:

 IsEmpty ( Field1 ) or IsEmpty ( Field2 )  

 

35 minutes ago, Smiley said:

for some reason it is not working .

"is not working" is not a good description of a problem. You should say: Field1 contains X, Field2 contains Y, the expected result is Z, actual result is W.

 

Edited by comment
Link to comment
Share on other sites

2 hours ago, Smiley said:

i am trying to product a calculation that would only show an asteric if  field 1 is filled and field 2 is empty.

Hi Smiley!

Is this only for display?  Instead of creating a calculation field, you might wish to use a Hide calculation instead.  This would eliminate an unnecessary calculation field.  Just type the asterisk as text into the portal top row then apply a hide calculation of:

not IsEmpty ( child::Approved ) 
or
IsEmpty ( child::date )

 

2 hours ago, Smiley said:

the second statement is beacuae it is in a portal and i don`t want it to show if no record exists.

The above example should work for you ( please see attached file )

fields.fmp12

BTW, the IsEmpty ( child::date ) could be further shorted to boolean (if you wish) of :  not child::date since dates are numbers and any number would return True.

Link to comment
Share on other sites

This topic is 1820 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
 Share

  • Similar Content

    • By rmstar
      Basic question.... Where do I find help on partial word searches?  I've been ...searching.... for a good writeup on FMP search operators that cover this to little avail.
      I need a expression that will search, get to a character, and then ignore/wildcard from there.
      So a search on "Chicago" will return:
      Chicago Chicago-IL Chicago-001 and so forth.....
       
    • By NewBoard
      I have a form in which users make measurements of multiple parts, then input the max and min measurements. I then have conditional formatting that compares these maxes and mins to the hard mins and maxes for that part. If the inputted max is larger than the hard max, or the inputted min is smaller than the hard min; the conditional formatting is supposed to highlight that measurement in red. This has worked in almost every case I have tested so far, except for one strange case. I have a hard min of 9.8, and my user is attempting to input 10 as the min. FileMaker is highlighting this in red, even though 10 is larger than 9.8. When we change it 9.9 it isn't red, but 10.1 makes it red as well. I have no idea why this is happening, so any assistance in this matter will be greatly appreciated!

  • Who Viewed the Topic

×
×
  • Create New...

Important Information

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