Edit Script Dialog
ON THIS PAGE
The Edit Script dialog is opened from the File menu or by clicking on the Edit Script symbol in the toolbar.
Here it is possible to enter and execute a script that connects the document to an ODBC data source, or to data files of different types, and fetches the demanded information.
Scripts can be typed manually, or generated automatically. Complex script statements must, at least partially, be entered manually.
The Edit Script dialog uses autocomplete, so when typing, the program predicts what is wanted to type without having to type it completely. The predictions include words that are part of the script syntax. The script is also color coded by syntax components. It may be customized by choosing Tools and Editor Preferences.
At the top of the dialog a menu bar, with various script related commands, is found. The most frequently used commands also appear in the toolbar. In the toolbar there is also a dropdown list for the tabs of the script.
Menus in the Edit Script Dialog
|Reload||Executes the script, closes the dialog and opens the Fields page in the Sheet Properties dialog. This command is also available on the Edit Script dialog toolbar.|
|Debug...||Starts the script execution in the debugger. The debugger is used for searching for errors in the script. Every script statement can be monitored and the values of the variables can be examined while the script is executed. This command is also available on the Edit Script dialog toolbar.|
|Edit Hidden Script...||Opens a script tab for hidden script. Here it is possible to define a hidden part of the script, which is executed before the general script at each reload. Hidden script tabs are always shown to the left of the open script tabs. A password is required to create or access hidden script.|
|Change Hidden Script Password...||Opens the New Hidden Script Password dialog where a new password for access to the hidden script can be set.|
|Create Hidden Script||Opens the New Hidden Script Password dialog, where a password for the hidden script must be set, and then opens a new script tab in the script window called Hidden Script. Here it is possible to define a hidden part of the script, which is executed before the general script at each reload. Hidden script tabs are always shown to the left of the open script tabs.|
|Remove Hidden Script||Removes the hidden script from the Edit Script dialog.|
|Save Entire Document||Saves the active document in a file. Data, script and layout are saved. This command can also be invoked by the following keyboard shortcut: Ctrl+S. This command is also available on the Edit Script dialog toolbar.|
|Save Entire Document As...||Saves the active document in a new document file under a new name.|
|Open External Script File||Makes it possible to browse for a file containing a script and opens it in a new tab in the script pane, where it can be edited with the help of QlikView's color coding.|
|Save External File||Saves the external script file.|
|Export to Script File...||Saves the entire script in a text file to be specified in the Save script dialog that appears. The file will have the extension .qvs.|
|Print Tab...||Allows the printing of the active script tab on an optional printer. This command can also be invoked by the following keyboard shortcut: Ctrl+P. This command is also available on the Edit Script dialog toolbar.|
|Print All Tabs...||Allows the printing of the entire script on an optional printer. Hidden script will not be printed via this command.|
|Table Viewer||Opens the Table Viewer dialog where the structure of the loaded data can be studied in a graphical view of tables, fields and associations. This command can also be invoked by the following keyboard shortcut: Ctrl+T.|
|Undo||Undoes the latest change (multiple step undo is possible). Equivalent to pressing Ctrl+Z.|
|Redo||Redoes the latest Undo. Equivalent to pressing Ctrl+Y.|
|Cut||Exports the selected text to the Clipboard. This command is is also available on the Edit Script dialog toolbar. Equivalent to pressing Ctrl+X.|
|Copy||Copies the selected text to the Clipboard. This command is also available on the Edit Script dialog toolbar. Equivalent to pressing Ctrl+C.|
|Paste||Pastes the contents of the Clipboard into the dialog at the position of the cursor. This command is also available on the Edit Script dialog toolbar. Equivalent to pressing Ctrl+V.|
|Delete||Deletes the selected script text. Equivalent to pressing Del.|
|Clear Entire Script||Clears the script, i.e. removes all the text except the initial autogenerated set statements.|
|Select All||Selects the entire script text. Equivalent to pressing Ctrl+A.|
|Find/Replace...||Opens a dialog which makes it possible to find and replace numbers or characters in the script. This command is also available on the Edit Script dialog toolbar. Equivalent to pressing Ctrl+F.|
|Goto...||Opens a dialog which makes it possible to go to a specified line number in the script. Equivalent to pressing Ctrl+G.|
|Upper Case||Puts the selected script text in upper case.|
|Lower Case||Puts the selected script text in lower case.|
|Invert Case||Inverts the casing of the selected script text.|
|Capitalize||Capitalizes the selected script text.|
Transforms a text row in the script to a comment.
|Uncomment||Transforms the text row back into original script text.|
|Indent||Indents the highlighted lines in the script.|
|Outdent||Outdents the highlighted lines in the script.|
|Set Statement||Opens the Set Statement Wizard where it is possible to enter a new set statement and choose a predefined statement.|
|Environment Variables||Inserts the number interpretation variables in the script based on the operating system defaults.|
|Script File||Makes it possible to browse for a file containing a script or part of a script and inserts its contents into the script at the position of the cursor.|
|Include Statement||Opens the Include Script Files dialog, where it is possible to browse for a script file with one of the following formats: qvs (a previously saved QlikView script file), txt or sql.|
|Domain SID||Retrieves the NT domain security ID for use in the script. The NTDOMAINSID is employed in section access as one of the reserved fields that govern NT security.|
|Test Script||Inserts an autogenerated test script.|
|Load Statement||Inserts a load statement, either From File or Inline. Choosing Inline opens the Inline Data Wizard with the help of which it is possible to create load inline statements from a spreadsheet style control.|
|Section Access||Inserts a section access statement either from a Publisher Authorization table or Inline.
Choosing Publisher Authorization opens the File Wizard.
Choosing Inline opens the Access Restriction Table Wizard.
|Connect Statement||Inserts a connect statement in the script.|
|Disconnect Statement||Inserts a disconnect statement in the script.|
The Tab menu helps to organize the structure of the script.
|Add Tab...||Adds a new script tab. The script will be executed tab by tab in order from left to right. If the current script tab is part of the hidden script, the new tab will also be created within the hidden script.|
|Insert Tab at Cursor...||Inserts a new tab after the active tab. Any text on the active tab positioned after the cursor will be moved to the new tab.|
|Rename...||Opens a dialog for renaming the active tab.|
|Promote||Moves the active tab one step to the left. Tabs cannot be promoted to the left of the hidden script tab.|
|Demote||Moves the active tab one step to the right.|
|Merge with Previous...||All text on the active tab is moved to the end of the preceding tab and the active tab is deleted.|
|Remove...||Removes the active tab. The last remaining script tab cannot be removed.|
|ODBC Administrator 64 bit...||Opens the ODBC Data Source Administrator for 64-bit ODBC drivers.|
|ODBC Administrator 32 bit...||Opens the ODBC Data Source Administrator for 32-bit ODBC drivers.|
Opens the User Preferences dialog where it is possible to set the font and color of the different text types appearing in the script.
|Syntax Check||Checks the syntax of your script and stops at the first error.|
Help opens the online help for QlikView.
Panes in the Edit Script Dialog
There are two panes in the Edit Script dialog: the script pane at the top, and the tool pane at the bottom of the dialog.
The script pane contains the actual script. Each script line is numbered. The script may be divided into several parts appearing on separate tabbed pages which are executed from left to right.
If a hidden script is used, it may be viewed under a separate tab to the very left (provided that the password has been given).
The script is color coded by syntax components. The color coding may be customized by choosing Editor Preferences from the Tools menu.
The tool pane consists of four tabbed pages containing functions for script generation.
The Data page contains basic commands for getting data into QlikView:
The commands in the Database group are used to create a connection to and select fields from a data source. If a commercial DBMS is used it is possible to use ODBC or OLE DB as an interface between QlikView and the database. An ODBC or OLEDB driver that supports the DBMS must be installed on the computer before it is possible to retrieve data over the ODBC/OLE DB interface. Once the appropriate ODBC/OLE DB driver is installed, the database must be configured as an ODBC data source.
|OLE DB||The connection to the data source is established using OLE DB.|
|ODBC||The connection to the data source is established using ODBC.|
|QVSAdminDataProvider.dll||This custom connector gives the possibility to connect to the QlikView Server and load information from the DMS and collaboration objects.|
|Custom...||Any custom data source will also appear in the drop-down box for selection. QlikView offers an open source plug-in interface, providing possibility to program custom interfaces to various types of data sources not covered from the traditional file, ODBC or OLE DB interfaces. The typical case is data available via Web Services. The plug-in should be programmed according to specifications shown in a template code provided (on request) as open source from Qlik and compiled as a dll. The dll is then placed next to the QV.EXE file making the custom source available to use.|
|Force 32 Bit||Normally, QlikView uses 64-bit providers. In case a data source with a 32-bit driver is to be used, check this option to force the ODBC/OLEDB connect statement to a 32-bit provider.|
|Connect...||Opens the Data Link Properties dialog in which a data source can be selected, or the Connect to Data Source dialog where an ODBC data source can be selected.|
|Select...||Opens the Create Select Statement dialog.|
The Data from Files group is where data retrieval from other data sources can be made.
|Relative Paths||If this setting is enabled, QlikView will use relative paths instead of absolute paths in the script. Relative paths are normally required when a document is to be moved between different computers. This setting is also available in the User Preferences dialog. If it is changed there, it will also be changed in the Edit Script and Edit Hidden Script dialogs.|
|Use FTP||Enable this setting to select files from an FTP server, when clicking Table Files, QlikView Files or Include.|
|Table files...||Opens the Open Local Files dialog listing table files. Selecting one or several files and pressing OK will generate one or several load statements. When executed, the script loads data from the corresponding files. If the Use FTP option is checked (see above), select a server from the list (or enter the server to use, then click Connect). When this is done, select a text file.|
|QlikView File...||Opens the Open QlikView File dialog. When a file is selected a binary statement is generated in the first line of the script. This statement loads the data from the QlikView file but the layout settings will not be used.|
|Web Files...||Opens the File Wizard where it is possible to enter a URL as a source for the database table.|
|Field Data||Opens the File Wizard where it is possible to load the contents of an already loaded field.|
On the Variables page, the controls for pasting syntax relating to QlikView variables, are found.
|Paste||Pastes the selected function into the script.|
|Show System Variables||If this check box is marked, the list in the Variables drop down will include the system variables.|
QlikView offers an open-source plug-in interface, providing possibility to program custom interfaces to various types of data sources not covered from the traditional file, ODBC or OLEDB interfaces. The typical case is data available via Web Services. The plug-in should be programmed according to specifications shown in a template code provided (on request) as open-source from Qlik and compiled as a dll. The dll is then placed next to the QV.EXE file making the custom source available to use. It will then appear in the drop-down box for selection.
The Functions page contains tools for navigating and pasting QlikView standard functions.
|Function Category||Select a category in the drop-down list to see the corresponding functions in the Function Name list below.|
|Function Name||This drop-down list contains standard QlikView script functions.|
|Paste||Select a function in the Function Name list and paste it into the script at the cursor position.|
On the Variables page you will find controls for pasting syntax relating to QlikView variables.
|Paste||Pastes the selected variable into the script.|
|Show System Variables||If this check box is marked, the list in the Variables drop down will include the system variables.|
The Settings page contains security settings for the QlikView script.
|Script Privileges||Open Databases in Read and Write Mode
If this option is selected the mode is write qualifier in select statements will be enabled for use.
Can Execute External Programs
If this option is selected execute statements may be used in the script.
|Settings||Scramble Connect User Credentials
If this check box is marked, the USERID and PASSWORD in connect statements will be scrambled in the script.