Creating reusable load script with QVS files
Create reusable blocks of load script using QlikView script (QVS) files.
You can add a block of Qlik load script to a text editor and save it as a QVS file. The QVS can then be uploaded to Qlik Cloud or added to a web storage provider. You can also download versions of script in History as QVS files. The QVS can be inserted into the load scripts of scripts and apps from your data files or web storage. This allows you to use a single script across multiple apps and scripts. For example, you could use a QVS to:
-
Set variables.
-
Define commonly used subroutines.
-
Set color palettes.
-
Define calendars.
In Catalog, you can view uploaded QVS files and filter them using the Scripts filter. Opening a QVS file opens QVS viewer. Uploaded QVS file access follows space permissions for data source access.
Navigating QVS viewer
In the Analytics activity center, you can open a QVS file to view it in QVS viewer. QVS viewer contain two sections: Overview and Preview.
Overview contains information about the script and a quick preview of the script. You can see the following information:
- Owner: Owner of the script.
- Creator: Creator of the script.
- Space: Space the script where the script is located.
- Created date: Date the script was created.
- File size: Size of the script.
Under Quick view, you can preview the script.
In Preview, you can view the script in more detail. You can open the search panel by clicking . You can open the syntax help by clicking .
Creating QVS files
Create QVS files in a text editor outside of Qlik Cloud. Load script history can also be downloaded as QVS files.
Do the following:
-
Create a block of load script in an app or script.
Creating your load script in an app or script allows you to test the script first before adding it to a QVS files.
Alternatively, find a block of load script you want to reuse.
-
In a text editor, copy and paste the block of load script you want to reuse.
-
Save the load script as a file with the QVS extension.
You can now upload the QVS file to Qlik Cloud or a web storage provider.
Uploading QVS files
Do the following:
-
Go to the Create page of the Analytics activity center and select Upload.
-
Select Script.
-
Drag and drop your QVS files into the Drop your files here dialog.
Alternatively, click Browse and navigate to your QVS files.
- Select a destination space for the files.
- Optionally, add tags to the QVS scripts.
- Click Upload.
Editing QVS files
You cannot edit a QVS file in Qlik Cloud. If a file QVS requires changes, make the changes to the file in a text editor and reupload the file.
Limitations
QVS files have the following limitations:
-
Included scripts displays the first 50 QVS files included in the load scripts. If there are more QVS, they will be executed when the load script runs, but will not be listed in Included scripts.
-
Preview for QVS files is not available on mobile.
-
If you previously uploaded QVS load script as a TXT file, the files will still function. They will not be treated as QVS files however unless their file extension is changed to QVS.