Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Extract qlikview script from QVW

Hi,

  I have recently come to know that we can export the script out of a qvw using File->Export to script file.

  Is there a way to do this through command line? (I essentially want to automate this).

  My use case is that I have similar qlikview script in many qvw's and for any small change I need to do, I have to open each qvw and make the change. Instead, I would like to extract the scripts and make any repititive changes using some text processing on the scripts.

Thanks in advance,

Venkatesh

1 Solution

Accepted Solutions
Highlighted
Not applicable

For version 10 and later you can create folder with the same name as the qvw with a "-prj" suffix (e.g., create document-prj folder for document.qvw file) in the same folder as the qvw file and qlikview will automatically export the document layout when saving and merge any changes when opening. You can then script the following: make the changes to the LoadScript.txt file, open the qvw file, save the qvw file.

View solution in original post

8 Replies
Highlighted
Not applicable

Hi,

you can write your script(s) in text file in general and the include this text file in qvw using "Include" variable. For example: if your script text file is named "script.txt" then in qv script jut type: $(Include=script.txt). The content of script.txt will be executed on reload. So you can make the changes in txt files without the need to open the qv.

Be aware that this will not make the content of script.txt visible inside qv.

P.S. In the example the script.txt is in the same folder with the qvw file. If you plan to make script files in separate folder don't forget to add the path to the script.txt file

Stefan

Highlighted
Not applicable

Hi Stefan-Stoichev,

  Thanks for your response.

  I am familiar with the usage of $(include=script.txt). However, my question was more around: once we have some qvw files (with script inside them), can we export the script using command line (as an alternative to File -> Export to script).

Highlighted
Not applicable

I'm not sure that is possible to export the script using command line.

You can write a macro that can save the entire script to disk after each reload. But i'm not sure that this will meet you requirements.

Stefan

Highlighted
Not applicable

For version 10 and later you can create folder with the same name as the qvw with a "-prj" suffix (e.g., create document-prj folder for document.qvw file) in the same folder as the qvw file and qlikview will automatically export the document layout when saving and merge any changes when opening. You can then script the following: make the changes to the LoadScript.txt file, open the qvw file, save the qvw file.

View solution in original post

Highlighted
Not applicable

Hi vhuynh,

  That worked! Thanks a lot

  I see a lot of files in this folder and looking at a couple of them, I am guessing they capture the entire qvw configuration (along with script, UI objects, Document layout etc.). So now my question is: can we recreate the qvw (without data) from this folder? I did the following but without success:

  • Copied the folder (document-prj) to a new location
  • Created a new document.qvw at that location
  • I guessed that when I open document.qvw, it would load the script from LoadScript.txt. But it does not happen so.

Am I missing something here?

  My use case: If recreating the qvw from "-prj" folder is possible, I would like to backup this folder on a remote location (say through SVN) as it is small in size. I can then use it later to recreate the qvw in case my working copy gets corrupt.

Thanks

Venkatesh

Highlighted
Not applicable

Hi ekvenkatesh,

I notice that the full path is writen on XML files. (Ex: On file "DocProperties.xml")

Did you tried "recovery" on the same location? That should work...

Highlighted
Not applicable

Qlikview 11 SR1 has native support for SVN.

Highlighted
Contributor
Contributor

Hi Van Huynh,

It is working to Create folder name with -prj.

I have some more information about this, If it is any way to Extract Qlikview script from QVW Edit script code?

Ex:

I have sample.qvw file in this file I have edit script , my requirement is when I was reload this sample.qvw application then automatically script ( sample.qvw ) will be stored into some another location and  any Edit Script is there to write

with in the sample.qvw application and not using any macros.

Can you please help me for this.

Thanks and regards,

Bakshu