February 23, 200620 yr 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
February 23, 200620 yr 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
February 23, 200620 yr 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
February 23, 200620 yr 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!)
February 23, 200620 yr Lol what are they your reindeer, they dont quite rhyme but nevertheless... If(IsEmpty(Field 1) xOR IsEmpty(Field 2) ; 0 ; 1) ? ~Genx
February 23, 200620 yr In the absence of -Queue-, both from your list and - even more regrettably - from these forums: not IsEmpty ( Field1 ) xor IsEmpty ( Field2 )
February 23, 200620 yr .. hmmm, that evaluating to boolean eh? Rightio. Where is good old -Queue- anyway? ~Genx
February 23, 200620 yr Author 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
February 23, 200620 yr Lol, i'm a lad, in the mean time though how were you planning on utilizing the choose function vaughan? ~Genx
Create an account or sign in to comment