Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

Lol what are they your reindeer, they dont quite rhyme but nevertheless...

If(IsEmpty(Field 1) xOR IsEmpty(Field 2) ; 0 ; 1) ?

~Genx

Posted

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

Posted

Lol, i'm a lad, in the mean time though how were you planning on utilizing the choose function vaughan?

~Genx

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.