The "and" operator not working

This topic is 2803 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.

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

...

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

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
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.

Share on other sites

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

Create an account

Register a new account

• Similar Content

• Search until, then

By rmstar,

• 8 replies
• 1,082 views
• Less than operator not behaving as intended

By NewBoard,

• 2 replies
• 3,783 views
×
×
• Create New...