Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I am new to QlikView and have recently run into a problem. In my application, I have a chart similar to the example Google Maps chart that comes standard in QV 9. I would like to create a button that runs a macro to create a variable, which I am then able to call on in the chart expressions (in order to dynamically resize and recolor the dots based on the variable's value created by the button).
Any advice on how to go about this? I'm stumped.
Hi,
I made an example. It's very simple
If you have any question feel free to ask.
Steve
Hello,
I don't understand your question very well, but if you just want to create a variable:
ActiveDocument.CreateVariable newVar
Set v = ActiveDocument.Variables(newVar)
v.setContent variableContent, true ' variableContent is the formula or expression for your new variable
Steve
Hi Steve,
Thank you for the response and I apologize for being so confusing. It looks like this is going in the right direction but I still can't get it to work properly. What is "v" in the code? The variables I'm creating are not passing to the chart.
What I would like is this: 1. Button to create a variable called "newVar". Eventually, I want Button2 and Button3 to do the same thing via different formulas.
Button 1 will have:: newVar = sum(Sales) <-- Sales is a field in data table in the sheet, On click it sets and the chart is able to call it to dynamically change.
2. Separate sheet object, a Chart , set to reflect the value of the newVar.
Hi,
I made an example. It's very simple
If you have any question feel free to ask.
Steve
Thanks Steve! Solution was perfect.
I might have another question coming soon regarding a button to set a a Year to Date, Week to Date, and Last Week value in separate Year, Week, and Day list boxes but I'm going to give it some more thought first. I really appreciate your help.
~MIchael
Hey Michael, I forgot to tell you that you have to verify if the variable is already created every time you press the button.
Steve