Disabling a roster row


I am trying to disable a row of a fixed roster depending on the answer to a question previously asked outside the roster. Let’s say fixed roster has items A and B, I want to disable B if the answer to a question q1 == 0 ( this question is outside the roster). I tried the following syntax :
(q1== 0)? (@rowcode == 1 && @rowcode != 2) : (@rowcode == 1 && @rowcode== 2)

I also tried other permutations and combinations but those are not working either. Probably I am missing out some trivial part of the logic but I am unable to see it. Any help would be great!


Assuming the numeric code for B is 2, try the following:
@rowcode!=2 || q1!=0

Note that in your expression:
(@rowcode == 1 && @rowcode== 2) is always false, as one numeric code may not be equal to two different constants at the same time.
(@rowcode == 1 && @rowcode!= 2)
is inefficient (if @rowcode is 1, then automatically it is not 2)

Whichever way you program it, make sure it behaves adequately when q1 is not answered, (rather than zero or non-zero).

Right! Got it! Thank you!!