Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

True False Calc

Featured Replies

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

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

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

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

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

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

~Genx

In the absence of -Queue-, both from your list and - even more regrettably - from these forums:

not IsEmpty ( Field1 ) xor IsEmpty ( Field2 )

.. hmmm, that evaluating to boolean eh? Rightio. Where is good old -Queue- anyway?

~Genx

  • 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

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

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.