INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Calculated Field to check if two specific fields are empty  (Read 869 times)

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Calculated Field to check if two specific fields are empty
« on: February 01, 2014, 05:53:53 pm »

hi,

Can anyone help me: I want to add a library field 'xyz', which's value is calculated, based on what the value of the fields 'a' and 'b' are. I know how to add fields, but can't get the formula right:  

if value of field 'a' = empty AND value of field 'b'=empty, then value of 'xyz' tagged'. Else value of field 'xyz' = 'not tagged'

I found the formula 'isempty[field]', but can't figure out how to check this or two fields.

many thanks!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Calculated Field to check if two specific fields are empty
« Reply #1 on: February 01, 2014, 09:34:06 pm »

There are a couple of tricks you can use to simulate AND operations, and some more still when you're just testing for emptiness in both.  Let's shoot for the latter.  If A is empty and if B is empty, then the concatenation of A and B is also empty.  So, you can use this:

   if(isempty([A][B]), both empty, not both empty)

Other ways to simulate AND, OR and XOR:

    http://wiki.jriver.com/index.php/Database_Expressions_AND_OR_And_XOR
Logged
The opinions I express represent my own folly.

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: Calculated Field to check if two specific fields are empty
« Reply #2 on: February 02, 2014, 01:37:36 pm »

Ingenious. I am glad I asked, I'd never would have come up with that!
Thanks much, Mr. C!
Logged
Pages: [1]   Go Up