Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I can't find in API quide how to programmaticaly edit the script which describes loading data process (the script which is a part of qvw file).
How can it be done? I'm new in QV.
I must say, - this is not exactly a task for a new developer...
However, if you have to programmatically edit the script, you can approach it in 2 ways:
1. Using $-sign expansions. You can build portions of your script within a variable, and then have them executed using $(var) syntax. For example:
LET vScriptPart = 'LOAD A,B,C RESIDENT MyTable;' ;
$(vScriptPart)
The first line assigns the string to the variable, and the second part executes the statement by substituting the variable name by the string.
2. Using macros and QlikView API. The method for accessing the Script is called doc.Script. Here is an example from the API Guide:
rem ** add new line to script **
set docprop = ActiveDocument.GetProperties
docprop.Script = docprop.Script & "Load * from abc.csv;"
ActiveDocument.SetProperties docprop
I must say, - this is not exactly a task for a new developer...
However, if you have to programmatically edit the script, you can approach it in 2 ways:
1. Using $-sign expansions. You can build portions of your script within a variable, and then have them executed using $(var) syntax. For example:
LET vScriptPart = 'LOAD A,B,C RESIDENT MyTable;' ;
$(vScriptPart)
The first line assigns the string to the variable, and the second part executes the statement by substituting the variable name by the string.
2. Using macros and QlikView API. The method for accessing the Script is called doc.Script. Here is an example from the API Guide:
rem ** add new line to script **
set docprop = ActiveDocument.GetProperties
docprop.Script = docprop.Script & "Load * from abc.csv;"
ActiveDocument.SetProperties docprop
Thanks for your reply.
now I try to programmaticaly create tablebox, add some fields to it and reload data using some script.
unfortunately it does not work. it seems that creating table box and adding fields is not enough.
details in http://community.qlik.com/forums/t/39110.aspx. I would be grateful if you looked at this post...