Smiley Posted August 9, 2016 Posted August 9, 2016 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.
Wim Decorte Posted August 9, 2016 Posted August 9, 2016 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 )] ...
Smiley Posted August 9, 2016 Author Posted August 9, 2016 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
comment Posted August 9, 2016 Posted August 9, 2016 (edited) 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 August 9, 2016 by comment
LaRetta Posted August 9, 2016 Posted August 9, 2016 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.
Recommended Posts
This topic is 3096 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 accountSign in
Already have an account? Sign in here.
Sign In Now