7 Replies Latest reply on Oct 18, 2016 7:36 AM by CarrieB.

# Calculation for Hiding a Field

I am wondering if there is a calculation to hide a field when 5 other fields are either empty or equal 0. In other words, Field A on my layout should be hidden when Field B is empty or 0 and Field C is empty or 0 and Field D is empty or 0 and Field E is empty or 0 and Field F is empty or 0. If this is possible, I have not been able to figure out how to properly write the calculation.

Any feedback is much appreciated!

Thanks,

Carrie

• ###### 1. Re: Calculation for Hiding a Field

Hi,

I think you're looking for "hide when" ...

IsEmpty (

fieldB & fieldC & fieldD & fieldE & fieldF

)

it tests if the concatenation of all the fields is empty (ergo, all fields are empty).

Or, if they are number fields ...

"hide when" (fieldB + fieldC + fieldD + fieldE + fieldF) = 0

• ###### 2. Re: Calculation for Hiding a Field

Like David writes, you should work with Hide object when that you find in Inspector. Here you write a formula that if it is true hide your object and if it is not true shows your object

• ###### 3. Re: Calculation for Hiding a Field

He wrote "empty or 0", so need more information for possible values to use your shortcut calculation (-1 + 1 also be 0)

• ###### 4. Re: Calculation for Hiding a Field

I do understand how to use the inspector to make a field hidden or visible. I'm just struggling with the proper calculation in this case. I can't use the hide when empty or hide when all 5 fields equal 0. I need to hide based on each individual field having a result of empty or zero. As user19752 mentioned, the fields could total 0 even if other values were entered. If you look at the attached image, please notice the "rows" labeled Interest, Charitable Contributions and Depreciation. I want to hide all of these fields, but some of the fields have a value of 0 and some are empty. I hope this makes what I am trying to achieve more clear and do appreciate your input!

• ###### 5. Re: Calculation for Hiding a Field

this will just indicate if all fields are empty or zero:

= (

( IsEmpty(fieldA) or fieldA = 0 ) and

( IsEmpty(fieldB) or fieldB = 0 ) and

( IsEmpty(fieldC) or fieldC = 0 ) and

( IsEmpty(fieldD) or fieldD = 0 ) and

( IsEmpty(fieldE) or fieldE = 0 )

)

• ###### 6. Re: Calculation for Hiding a Field

I thought I might be missing some parenthesis somewhere, but when I try the calculation above it tells me there are too few parameters in this function.

• ###### 7. Re: Calculation for Hiding a Field

Using the following works though. Thanks!

( IsEmpty(fieldA) or fieldA = 0 ) and

( IsEmpty(fieldB) or fieldB = 0 ) and

( IsEmpty(fieldC) or fieldC = 0 ) and

( IsEmpty(fieldD) or fieldD = 0 ) and

( IsEmpty(fieldE) or fieldE = 0 )