Conditional formula for YES/NO parameter

Conditional formula for YES/NO parameter

luis_brionesalonso
Advocate Advocate
4,526 Views
11 Replies
Message 1 of 12

Conditional formula for YES/NO parameter

luis_brionesalonso
Advocate
Advocate

Hi, 

I've been having an issue that I cannot resolve regarding conditional formulas for YES/NO parameter. 

 

I have three YES/NO parameters: A,B, and C. A is only YES when a certain condition is met, B is a simple Tick Box (YES/NO instance parameter). What I want to achieve is the following: 

If A=NO then C=NO, if A=YES then C=NOT(B)

or

If A=Yes then C=NO, if A=NO then C=NOT(B).

 

Does anybody know how you could possibly write a formula for C so that these conditions are met?

0 Likes
Accepted solutions (1)
4,527 Views
11 Replies
Replies (11)
Message 2 of 12

Luiscko
Collaborator
Collaborator

I think the best way is create two parameters yes and no, one for AB and another for C, when you obtain your first result then you can apply one script to Dynamo pretty easydfs.PNG

Luis Rodríguez
BIM Manager | Digital Transformation Lead


alt="EESignature" width="244" height="22">


Your Name
Encontraste util este post, compartelo y dale like para que llegue a mas personas como tú.
Si tu respuesta fue solucionada, te agradecemos que des click en el boton SOLUTION.

0 Likes
Message 3 of 12

luis_brionesalonso
Advocate
Advocate

I'm not sure I see how the Dynamo-script is applicable here. The parameters are meant to be used as visibility parameters in a detail family if it helps. The parameters have to remain seperate as well since the goal is to have parameter C=not(B) when A=YES and C=NO when A=NO.

 

A and B can vary independent from each other.

0 Likes
Message 4 of 12

barthbradley
Consultant
Consultant

@luis_brionesalonso wrote:

Hi, 

I've been having an issue that I cannot resolve regarding conditional formulas for YES/NO parameter. 

 

I have three YES/NO parameters: A,B, and C. A is only YES when a certain condition is met, B is a simple Tick Box (YES/NO instance parameter). What I want to achieve is the following: 

If A=NO then C=NO, if A=YES then C=NOT(B)

or

If A=Yes then C=NO, if A=NO then C=NOT(B).

 

Does anybody know how you could possibly write a formula for C so that these conditions are met?


 

Huh??? Makes no sense. It reads like C is never on.  If A and B are checked, C is unchecked.  If A and B are unchecked, C is also unchecked. 

 

Maybe you mean this:

 

C=and(not(A), not(B))

 

 

 

 

 

 

 

0 Likes
Message 5 of 12

luis_brionesalonso
Advocate
Advocate

As mentioned above, A and B are independent from each other. So there are four combinations, not two.

what I want to achieve:

If A=no then C=no, if A=yes then C=not(B)

 

So if A=yes and B=no then C=yes

If A=yes and B=yes then C=no

If A=no then C=no, whether B=yes or no

Hope this helps you understand.

 

 

0 Likes
Message 6 of 12

barthbradley
Consultant
Consultant

Did you try the formula I gave you above?  

 

C=and(not(A),not(B))

0 Likes
Message 7 of 12

chunton
Observer
Observer

Try this:

if(not(A), A, if(and(A, B), not(A), if(and(A, not(B)), A, B)))
0 Likes
Message 8 of 12

FAIR59
Advisor
Advisor
Accepted solution

@luis_brionesalonso wrote:

As mentioned above, A and B are independent from each other. So there are four combinations, not two.

what I want to achieve:

If A=no then C=no, if A=yes then C=not(B)

 

So in formula-language: IF(not(A),A,not(B))

Message 9 of 12

luis_brionesalonso
Advocate
Advocate

I'll try it out tomorrow, although I suspect that formula won't work since it reads as giving a YES value when A and B are NO and a NO value when A and B are YES, which is not what I am looking for. I think the formulas given below are the correct solution to my problem. 

0 Likes
Message 10 of 12

barthbradley
Consultant
Consultant

Yep. It doesn't work with the conditions you spelled out in your second post.  I just threw that one out based on what you wrote in your first post:  "C" is OFF when "A" is ON or OFF.   Understandably, a little confusing.   Actually, the correct formula for that one would be: "C"=1>2  Smiley Wink

 

 

0 Likes
Message 11 of 12

luis_brionesalonso
Advocate
Advocate

Works perfectly, thank you. Smiley Happy

0 Likes
Message 12 of 12

luis_brionesalonso
Advocate
Advocate

It actually does work when you rewrite it to C=and(A, not(B)) since it should only be on when A is on and B is off in this case. Thank you for the suggestion.

0 Likes