Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
I'm trying to set my chart title name by using a vbscript function
Function GetMyChartName()
GetMyChartName = "Bob"
End Function
In the Chart->Properties->Window Title I have
= GetMyChartName
This works and my chart title is Bob.
However, I want to use a variable for the chart name (This has already been set up as PresetVariable in the Variable Overview screen) so instead my function would be:
Function GetMyChartName()
dim var_value
var_value = ActiveDocument.Variables("PresetVariable").GetContent.string
GetMyChartName = var_value
end function
This does not work and it's the ActiveDocument line that is causing it to fail.
Can anyone shed any light on why?
Thanks,
Jes
Hi Jes:
If all you need to do is to dynamically set the chart name, you don't need to go through all the vbscript hassle.
Just use something like this --> http://www.learnqlickview.com/how-to-display-dynamic-titles-in-qlikview/
Hope this helps!
Not sure where the problem is, but as Ruben said, it's generally a bad idea to use macros in the UI, especially in expressions.
As an alternative, can you just reference the variable in the Caption expression like:
=PresetVariable
-Rob