need help with Boolean Expression in Condition
Hi @fcarmario, I need your help again and I would like to ask you if you could help me out.
I have 4 Multi select fields (field a, field b, field c, field d). Each field has the same values ("value 1", "value 2", "value 3", "value 4", "value 5"). Each field could have 0-5 values.
I want to see a transition only under the following conditions: 1.) only "value 1" is selected in one or more fields (thisfore I use the following expression) (("value 1" = %{field a} OR "value 1" = %{field b} OR "value 1" = %{field c} OR "value 1" = %{field d}) AND count(toStringList(%{field a}) UNION toStringList(%{field b}) UNION toStringList(%{filed c}) UNION toStringList(%{field d})) = 1)
2.) "value 1" is selected in one or more fields and also "value 2" could be selected in one or more fields.
could you help me with that?
thanks
Comments (10)
-
repo owner -
reporter hi @fcarmario 1) only value 1 is allowed. But is has to be selected in minimum one field. (e.g. "field a" = "value 1", "field b" = "value 1" or empty, "field c" = empty, "field d" = empty) this works allready with the mentioned expression.
2) those fields where "value 1" is selected, "value 2" is also allowed, but "value 2" could also be the only value. But "value 1" has to be selected somewhere. (e.g. "field a" = "value 1", "field b" = "value 2" or empty, "field c" = empty, "field d" = "value 1" and "value 2")
I guess option 2 should include option 1) and option 2). That means that minimum "value 1" has to be selected in any field.
I hope it is clearer now.
thankx
-
repo owner Hi @kweigel,
Try this expression:
"value 1" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) AND ("value 2" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) IMPLIES count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) = 2)
where aaaaa, bbbbb, ccccc and ddddd are field codes for the 4 Multi-Select custom fields.
-
reporter Hi @fcarmario thank you, but it is not working 100%. with your expression the transition is also shown, if in "field a" "value 1" and "value 3" is selected. But additionally to "value 1" only "value 2" should be allowed in the same or another field.
-
repo owner Hi @kweigel,
Use the following boolean expression:
"value 1" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) AND ("value 2" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) EQV count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) = 2)
I have simply replaced
IMPLIES
withEQV
. -
reporter hmmm... still not working.
I attached 2 screenshots In the attached example the transition "TecCat Truck" shouldn't be visible.
-
repo owner Hi @kweigel,
Use the following boolean expression:
"value 1" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) AND ("value 2" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) IMPLIES count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) = 2 AND count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) <= 2
another possibility is:
"value 1" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) AND (count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) > 1 IMPLIES count(toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) EXCEPT ["value 1", "value 2"]) = 0)
-
reporter hi @fcarmario option 1 is still not working. option 2 gives me an error
frustrating
-
repo owner Hi @kweigel,
Sorry, I made a mistake.
This is the correct boolean expression for option 1:
"value 1" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) AND ("value 2" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) EQV count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) = 2) AND count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) <= 2
Correct expression for option 2 is:
"value 1" in (toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) AND (count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) > 1 IMPLIES count((toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) EXCEPT ["value 1", "value 2"]) = 0)
-
repo owner - changed status to resolved
I close the issue, please reopen it if you find that provided solution is not satisfactory.
- Log in to comment
Hi @kweigel,
Sorry, but I have doubts about your description of the expected behavior.
Transition should be shown in any of the following 2 circumstances:
1) Only "value 1" in one or more fields.
2) "value 1" is selected in one or more fields, and "value 2" could be selected in one or more fields.