Ians Posted February 23, 2006 Posted February 23, 2006 Hi, Could someone help me with a calc, I would like to get a true/false result when: Field 1 and Field 2 (both empty) = 1 Field 1 and Field 2 (both not empty) = 1 Field 1 and Field 2 (either not empty) = 0 Thanks Ian
Singlequanta Posted February 23, 2006 Posted February 23, 2006 Here ya go. Attached is a filemaker example. /* Field 1 and Field 2 (both empty) = 1 Field 1 and Field 2 (both not empty) = 1 Field 1 and Field 2 (either not empty) = 0 */ If( (IsEmpty(Field1) and IsEmpty(Field2)) or (Field1 ≠ "" and Field2 ≠ "") ;1 ;0 ) calc.zip
Singlequanta Posted February 23, 2006 Posted February 23, 2006 I was assuming of course you're using FM7 or 8 when i attached that file. If not let me know and I'll send it in FM5/6 format. I also formatted the calculation that way so you could easily read it. It will work fine if you just copy and paste it into your solution. You can also copy and paste this: If((IsEmpty(Field1) and IsEmpty(Field2))or(Field1 ≠ "" and Field2 ≠ "");1;0) Cheers Steve
Vaughan Posted February 23, 2006 Posted February 23, 2006 Errr, the method of comparing a field to an empty string -- Field1 ≠ "" -- is not the recommended way to determine when a field is empty or not. The best practice is IsEmpty() which interestingly you used earlier in the function! Case( IsEmpty( field1 ) and IsEmpty( field ) ; 1 ; Not IsEmpty( field1 ) and Not IsEmpty( field2 ) ; 1 ; Not IsEmpty( field1 ) or Not IsEmpty( field2 ) ; 0 ) Now, we wait for somebody to get it down to a single line. Bonus points for using Choose() or XOR. C'mon Ray! C'mon MoonShadow! C'mon Ender, Comment, Ugo, Anatoli, Bob, Soren! C'mon Lee, take a break from moving ******** posts into their ******** correct forums and take a ******** crack at it! (Kinda got a bit ******** carried away there... tee hee!)
Genx Posted February 23, 2006 Posted February 23, 2006 Lol what are they your reindeer, they dont quite rhyme but nevertheless... If(IsEmpty(Field 1) xOR IsEmpty(Field 2) ; 0 ; 1) ? ~Genx
comment Posted February 23, 2006 Posted February 23, 2006 In the absence of -Queue-, both from your list and - even more regrettably - from these forums: not IsEmpty ( Field1 ) xor IsEmpty ( Field2 )
Genx Posted February 23, 2006 Posted February 23, 2006 .. hmmm, that evaluating to boolean eh? Rightio. Where is good old -Queue- anyway? ~Genx
Ians Posted February 23, 2006 Author Posted February 23, 2006 Hey thanks alot lads (I take it you are all Lads) worked a treet, I was close to it, but not close enough. anyway whats -Queue- when it's not at home?? Ian
Genx Posted February 23, 2006 Posted February 23, 2006 Lol, i'm a lad, in the mean time though how were you planning on utilizing the choose function vaughan? ~Genx
Recommended Posts
This topic is 6912 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