Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to programmaticaly edit the script which describes loading data process

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.

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Ask me about Qlik Sense Expert Class!

View solution in original post

3 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Thanks for your reply.

Not applicable
Author

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...