stann Posted August 18, 2004 Posted August 18, 2004 Hello I am trying to make a field calculation to show if any of 4 fields are empty the amount of another field should be placed in a field called "Amount Owed" I had IsEmpty( AFC, CASH, CHECK, AU):"BUYERSCOST"; "0" But that is not the way to write it. Can someone help me with this the fields that need to show if they are empty are AFC, CASH, CHECK, AU Thanks in Advance STAN
Lynn Johnson Posted August 18, 2004 Posted August 18, 2004 If ( IsEmpty ( AFC ) or IsEmpty ( CASH ) or IsEmpty ( CHECK ) or IsEmpty ( AU );BUYERSCOST;0) You need to use the IsEmpty for each field separately. Lynn
Philland Posted August 18, 2004 Posted August 18, 2004 Needs to be If (IsEmpty(AFC) or IsEmpty(CASH) or IsEmpty(CHECK) or IsEmpty(AU), BUYERSCOST, O) Phil
Lee Smith Posted August 18, 2004 Posted August 18, 2004 Amount Owed calculation should be something like. Case(IsEmpty(AFC), BUYERSCOST, 0, IsEmpty(CASH), BUYERSCOST, 0, IsEmpty(CHECK), BUYERSCOST, 0, IsEmpty(AU), BUYERSCOST, 0)
bruceR Posted August 18, 2004 Posted August 18, 2004 Another way of handlng this is to recognize that isEmpty(someField) evaluates to 1 if the field is empty. So an alternate way to write this is: Case( (IsEmpty(AFC) + IsEmpty(CASH) + IsEmpty(CHECK) +IsEmpty(AU) ) > 0, BUYERSCOST, 0)
-Queue- Posted August 18, 2004 Posted August 18, 2004 Or Case( Sum( (IsEmpty(AFC); IsEmpty(CASH); IsEmpty(CHECK); IsEmpty(AU) ) > 0; BUYERSCOST; 0 ) Any other variations we should offfer?
cobra Posted August 19, 2004 Posted August 19, 2004 How about: If(IsEmpty(AFC & CASH & CHECK & AU); BUYERSCOST; 0) I think this should work without problems (I haven't tested it, tho). BuyerCost is only used when all fields are empty. Hope this helps, Cobra
-Queue- Posted August 19, 2004 Posted August 19, 2004 The request was for BUYERSCOST to be used if any of the fields are empty, not only if all of the fields are empty. So that calculation would solve a different problem.
cobra Posted August 20, 2004 Posted August 20, 2004 Whoops! You're right. Sorry about that, I was distracted just before posting a reply. Some alternatives*: 1. If all your fields are numerical, you can use the following: If(Evaluate (field1 and field2 and field3 and field4); "All Are Full"; "One Is Empty") This solution has the added bonus (depending on your POV) of working when one of the fields has 0 (zero) or a space in it. 2. If some of the fields are textual, you can use: If(Evaluate (IsEmpty(field1) or IsEmpty(field2) or IsEmpty(field3) or IsEmpty(field4) ); "One Is Empty"; "All Are Full") For solution 2, if a field's value is 0 or a space, the calculation above will consider it to be non-empty. * you need to un-check "Do not evaluate if all reference fields are empty" for both solutions. IIRC, the Evaluate function is not part of FMP 6 or earlier. I've tested both solutions and they seem to work without problems in 7.0v2. Hope this helps!
Recommended Posts
This topic is 7469 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