Category

Saturday, December 7, 2013

QVS file - Reusable Qlikview Scripts


qvs (QlikView Script) files allows  developers to store QlikView load scripts into a external script file. The external script (qvs) file can be referred in multiple qvws.  Usually, script file with QlikView Script code is saved with .qvs extension. However, the file extension does not matter.

It always a good practice to store common script code into qvs files and include the script files in required qvws.
e.g: Calendar table code is often same in most of the Qlikview dashboards. Instead of replicating the same script in each and every dashboard, the Calendar table script can be stored into a qvs file and same can be referenced in required Qlikview applications.
This practice removes duplicating the same code in multiple applications and makes the maintenance easier.  Any update to code are made in single place eliminating redundant effort. Also, Qlikview application script now looks cleaner.

include or must_include statement is used to refer the external qvs files in Qlikview applications.
e.g:
Include examples

 $(include=load_script.qvs);
 $(must_include=load_script.qvs);



While script execution, Qlikview will replace the include statements with the code from the external qvs file.

While INCLUDE and MUST_INCLUDE serve the same functionality the major difference is must_include aborts the execution if the Qlikview cannot locate and load the external script file, while "include" statement skips the statement and moves onto next statement.

I usually use Notepad++ to edit the QVS files. Since, qlikviewaddict has developed custom language definitions for Notepad++ editor for Qlikview scripts with syntax highlight, auto-completion and tool tips feature. Refer my post for more details.

16 comments:

  1. The main motive of the Big data implementation services is to spread the knowledge so that they can give more big data engineers to the world.

    ReplyDelete
  2. I think Qlik is the best way to provide information and find out about solutions pertaining to complex IT problems.

    Qlik Rest Api Connection

    ReplyDelete