I have an expression that I need to reference in my Macro.
Basically, I had about 120 nested Ifs in the background color of one of my expressions, and Qlikview doesn't allow that many. So, I decided to write a macro instead. I need to reference the value of the expression in my macro, but I can only find ways to set expression properties, not reference the values themselves.
My If statements looked like:
If(Customer = 'A'
and((Label = 'Metric A' and Expression < .95)
or(Label = 'Metric B' and Expression < .96)),red(),
If(Customer = 'B'
and((Label = 'Metric B' and Expression < .99)
or(Label = 'Metric C' and Expression < .96)
or(Label = 'Metric D' and Expression < .90)),red(), .........
And I'm attempting to write my macro as:
set Customer = ActiveDocument.Fields("Customer").GetSelectedValues
If Customer.Item(i).Text = "A" Then
Set Labels = ActiveDocument.Fields("Label").GetPossibleValues
For i = 0 to Labels.Count
If Labels.Item(i).Text = 'Metric A' and//here's where I need to reference the expression// ExpressionValue < .95)......
Any help with this problem or a better suggestion would be much appreciated.