Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to test out the ability to pass a variable and value from the command line using the following:
"C:\Program Files\QlikView\QV.exe" /r /vParameterTest=1234 "C:\Desktop\QVW_QW\PatternTrending\reports\PatternTrending.qvw"
In my scripts tab, i declared a variable called "test" that is assigned the value from the passed in variable - "ParameterTest" so that I can then display that value on a text object to see if the value was passed in correctly but it is null.
Set test = ParameterTest;
Any help, please?
"C:\Program Files\QlikView\QV.exe" /r /vParameterTest=1234
This will assign the value 1234 to the variable ParameterTest. If you want to assign the value 'ParameterTest' to a variable called test then you need:
"C:\Program Files\QlikView\QV.exe" /r /vtest=ParameterTest
For your text object give it the expressions of :
= $(ParameterTest)
That should display 1234 & if so then you should be ok.
I am not sure you actually need the other variable called "test".
Right, I understand that it will assign the value 1234 to the variable ParameterTest. Since I read that you can only use variables passed in from the command line in your script or macro function, I created another variable called "test" so that I can assign the value from ParameterTest and display the value in a text object on the GUI.
My text object value is set as: "=test"
Yup , it is the dollar expansion you need.
Since I read that you can only use variables passed in from the command line in your script or macro function
That's not correct. There's only one kind of variable. If you have a variable you can set its value from the command line, or in the script (with the SET and LET statements) or in the Variable Editor or with actions assigned to triggers. The variables can be used in the script and in expressions in chart objects etc. So you don't need to create another variable to get the value from a variable that got its value via a command line option.
I actually tried that before too but no luck. I tried it with and without the enclosed $(). Just tried it again but no dice.
So did you use = $(ParameterTest) as the expression in your Text Object ?
Here's what I have and not working.
In Settings | Variable Overview what does it show for your variables ?