Problem

Assume you want to make an attribute (e.b) depending on another attribute (e.a). The latter is multivalued with two values in a value list: 'v' and 'w'. This situation is depicted in the following screenshot:

What should the expression be to show the attribute 'e.b' in case 'e.a' is either 'v' or 'w'?

Expectation

One would expect that the following precondition expression is correct:

e.a = [ "v" , "w" ]

And indeed it works for the following cases:

However if we deselect both options (this can be done by clicking on the entries of 'e.a' by holding ctrl) in the profile the value for 'e.a' = [] (an empty list). In that case 'e.b' is shown. This is because the expression e.a = [ "v" , "w" ] lead to TRUE. The reason for this is that this notation checks whether the first part before the '=' sign is a subset of '[ "v" , "w" ]'. And because an empty list is always contained in a filled list, it is always TRUE. Even if you would ask the runtime expression evaluator for the following expression:

e.a = [ "Hello world" ]

under the same conditions, it will result to TRUE.

Solution

The solution is to use another expression. There are multiple other ways to receive the desired behavior, we show some of them:

1) e.a = "v" OR e.a = "w"
 
2) e.a != [""]
 
3) SIZE(e.a) != 0



Related articles appear here based on the labels you select. Click to edit the macro and add or change labels. Note: the article itself also appears as related article, this is a known limitation.