I need a document variable event 'on change' trigger to run a macro, my problem is that the variable is an expression, the triggers only seem to work when the actual value contained in the variable changes.
this is my variable
=if(GetCurrentField(date_dimension) = 'Week Ending','Weekly',if(GetCurrentField(date_dimension)='Month Year','Monthly'))
I need to trigger my macro when the expression in the variable changes from 'Monthly' to 'Weekly' or vice versa.
does anyone know how to achive this?
Solved! Go to Solution.
Try to use a 2nd variable that equals the first then set the trigger to run on that variable change.
So something like this:
vCalc = if(Sum(Rate) > 0, 'True', 'False')
vAns = $(=vCalc)
then set the trigger to run when vAns changes.
This doesn't work unfortunately, it would seem that the content of the variable needs to change e.g. from 1 to 0
as the expression itself never changes it doesn't trigger the macro.
Your example works perfectly, I think the problem arises when trying to trigger a macro on a expression which is the result of a cyclic group. I've attached a file
which demonstrates this.
Previous discussion on topic :
So if I understand correctly... You want to trigger a macro when the cyclic group changes? Yes? If that is correct then you should be able to just add a trigger to the variable you set up (vCalc2) and it will run the macro code. Am I understanding correctly now or am I still missing the idea?
That's exactly what I'm trying to do. Unfortunatley adding a trigger to vCalc2 doesn't seem to work, if you click the
cyclic group in 'zack_2.qvw' the macro does not trigger.
That's very strange... on my version of zack_2 it works. Everytime you change the cyclic group from 'Name' to 'Sex' or vice versa it runs the macro. What version of QlikView are you using?
Mine is: 10.00.9061.7 SR3 64-bit