Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
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
vWeeklyMonthly
which contains
=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?
Thank you
Well it looks like it may be...
All I did was change the cyclic group...
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.
I made a little demo... it seems to be working. Maybe I missunderstood the question?
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
10.00.8935.7 SR2 32 - bit
Please don't tell me this is yet another bug!
Well it looks like it may be...
All I did was change the cyclic group...