need help with Boolean Expression in Condition

Issue #817 resolved
DVSE_Syncuser created an issue

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)

  1. Fidel Castro Armario repo owner

    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.

    • Can the rest of fields contain any value?

    2) "value 1" is selected in one or more fields, and "value 2" could be selected in one or more fields.

    • Can those fields where "value 1" is selected, also have other options selected?
    • The fields where "value 2" can be selected are different from those that have "value 1" selected?
  2. DVSE_Syncuser 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

  3. Fidel Castro Armario 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.

  4. DVSE_Syncuser 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.

  5. Fidel Castro Armario 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 with EQV.

  6. DVSE_Syncuser reporter

    hmmm... still not working.

    I attached 2 screenshots In the attached example the transition "TecCat Truck" shouldn't be visible.2017-09-29 14_24_22-Transition_ TecCat Truck - TM JIRA.png2017-09-29 14_29_23-[SALES-1069] test - TM JIRA.png

  7. Fidel Castro Armario 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)
    
  8. Fidel Castro Armario 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)
    
  9. Fidel Castro Armario repo owner

    I close the issue, please reopen it if you find that provided solution is not satisfactory.

  10. Log in to comment