QlikView - Scripting

Scripting is a very powerful feature in QlikView, which enables the control of the data load options and data transformations. It enables the use of many inbuilt functions available in QlikView and creates subroutines to be used across multiple scripts within a QlikViewdocument.

Scripting is done using the Script Editor. It is accessed from the File menu using Script Editor. We can also press Control +E to open the script editor window. It prepopulates some data formats that are set as default formats for the data to be processed. For example, the Thousand separator is a comma and date is in Month-day-year format. These can be changed to suit the incoming data as per the need.

 script Editor

Script Editor Features

Script editor has many features, which are accessed from the menu in the script editor window, which is a different menu from the main menu. Given below is a list of important features.

File Menu

  • Reload − Reloads the script and fetches the new data.

  • Upper/Lower Case − Converts the case of words as QlikView is case sensitive.

  • Comment − Used to comment blocks of code.

Edit Menu

  • Clear Entire Script − Clears the active script tab.

  • Open Script File − Opens the saved script files.

  • Table Viewer − Used to see the tabular view of the data being loaded.

Insert Menu

  • Environment Variables − Inserts a standard list of Environment variables.

  • Script Files − Allows to browse for script files and insert them.

  • Connect/Disconnect Statement − Used to connect or disconnect from external databases.

Tab Menu

  • Insert Tab − Inserts a Tab at the current cursor position.

  • Promote/Demote Tab − Allows to move the tabs from left to right and vice versa.

  • Merge with Previous − Used to merge the content of active tag with previous tab.

Tools Menu

  • ODBC Administrator 64 bit/ODBC Administrator 32 bit − Allows to set the correct DSN information for data sources.

  • Editor Preferences − Allows you to configure the text font and size, help features, shortcuts, default-scripting engine etc.

  • Syntax Check − Used to validate the syntax of the script code.