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 QlikView document.
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 the date is in the Month-day-year format. These can be changed to suit the incoming data as per the need.
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.