When an application designer defines Actions in a QlikView document, the dialogue implies they are triggered sequentially. In addition, the inclusion of PROMOTE/DEMOTE buttons reinforces the perception.
This is misleading. Although actions are
triggered sequentially, they always begin from the selection state that exists at the start of the first action.
Take a simple example with 1 field and 2 variables (see attached .qvw)
Add an action on Field1, OnSelect trigger. The trigger has two defined actions, both of which set a variable.
- The top action sets myVar to the values in field 1 using the concat() function, with no values selected this returns 1;2;3;4;5, so before you make a selection, myVar is 1;2;3;4;5
- The next action sets myVarTwo to myVar, myVarTwo is currently empty.
Examine what happens when making a selection in Field1, say the values 1 and 2. Recall the actions are triggered sequentially, but
the beginning point is the selection state at the start of the first action, as described above.
After the selection, the document has the following state:
- Field1 as 1 and 2 selected
- myVar is now 1;2
- myVarTwo is now 1;2;3;4;5 - which was the value of myVar at the start of the trigger
Multiple actions which are dependent upon a selection "earlier" in the trigger list will/may not work as expected. This is an intended design limitation which exists so QlikView may support both front-end and back-end actions without synchronization.
Note: this is not an example of how to configure triggers, merely an example of how triggers are executed and the possible results of multiple actions in a trigger.