Discussion Board for collaboration on QlikView Scripting.
I am using QV 11 Personal Edition
I have written a sub routine to calculate dates based on a selection.
I have kept a slider control and when the value of the slider changes, it should call this subroutine and inturn calculate the dates.
My sub routine is like this
SET var1 = some date conversion
SET var2 = other conversion
I will be using these variables in other controls
I went to the Field Event Trigger (the field is linked to the slider control) and added an External -> Run Macro action for OnSelect event
I tried to call the subroutine using
as well as
Both didn't work out. Can anyone help please..
How to use the variables already defined in the script editor inside a macro.
Now only I am checking my macro. It is throwing error.
Please help, I am new to QV & macro. How to use the functions of QV inside a macro and set & get variables
Is writing macro different from writing a subroutine in the script editor? I am confused.
Can we write a subroutine in Edit Script area instead of macro? If so how to call that in an event trigger action?
In macro you can get variable like this
Get and set variable value in macro
Set value = ActiveDocument.Variables("VariableName")
I am not sure writing a subroutin in the script editor. It is good practice to write macros in Macro Editor.
Writing script is to load data inside application.
Writing macros (CNTR+M). You can write Sub routine as well as function inside MAcros.
Subroutine can be directly called by name and function you have to write Call FunctionName.
Thanks Jagan & Swapnil. Will try these out.
May I know how to create a function?
It is throwing error.
I don't know what I did, I am unable to open the macro window itself.
When I press Ctlr+M or from the menu, QV is getting minimized. Anybody faced this issue?
Now the function is not throwing any error and i tried with msgbox and it shows correct value
I wrote like this
Function funName (var)
blah blah blah
funName = blah blah blah
But how to use this function in a trigger action? I want to pass a date as the param value and it will return another date
I am using a trigger action for a field value change and setting the return value to another variable
I tried calling the function, but it is not giving any output
as well as
Both didnt work. Any help please?