Execute

The Execute statement is used to run other programs while QlikView is loading data. For example, to make conversions that are necessary.

Syntax:  

execute commandline

Arguments:  

Argument Description
commandline

A text that can be interpreted by the operating system as a command line.

Enable Execute in QlikView

By default, execution of Execute statements during reload is disabled both in QlikView Server and QlikView Desktop. You can manually enable the Execute command in QlikView Server or QlikView Desktop installations.

QlikView Server

You can enable Execute statements for QlikView Server by modifying the QlikView Batch Settings.ini file.

Do the following:

  • Navigate to C:\Windows\System32\config\systemprofile\AppData\Roaming\QlikTech\QlikViewBatch and open the Settings.ini file.
  • Locate the line AllowExecuteCommand and set the value to 1 as shown below:
    AllowExecuteCommand=1

Now, when running the reload of the document from the QlikView Management Console, Execute statements are enabled.

Note: The execution of an Execute statement is registered in the QlikView Batch (QVB) log file. To generate QlikView Batch log files when you run the script in QlikView Server, open the Settings.ini file located in C:\Windows\System32\config\systemprofile\AppData\Roaming\QlikTech\QlikViewBatch and add the following flag:
EnableQVBLog=1

QlikView Desktop

Do the following:

  • On QlikView Desktop Start Page, click the Settings drop-down menu and select Users Preferences...
  • On the Security tab, select Script (Allow Database Write and Execute Statements) to enable the security override.
Note: The Script (Allow Database Write and Execute Statements) setting must always be enabled if you want to allow Execute statements in the script.
See: User Preferences: Security
  • Open the QlikView document in which you want to perform the Execute statement, and open the Script Editor by selecting Edit Script... from the File drop-down menu.
  • In the lower part of the Script Editor window, go to the Settings tab and select Can Execute External Programs.

Now, you can execute a statement in the script during reload.

It is possible to execute a statement during reload also if the setting Can Execute External Programs is not enabled in the Script Editor Settings. In this case, a Security Alert window appears every time you run a script containing an Execute statement. To allow the script to run the Execute statement, select Override Security, Execute This Statement from the options provided in the Security Alert window.

Note: The execution of an Execute statement is registered in log files. To enable the generation of log files when you run the script in QlikView Desktop, select Document Properties... from the Settings drop-down menu, and select Generate Logfile on the General tab.

Example:  

Execute "C:\Program Files\Office12\Excel.exe";

Execute "winword macro.doc";

Execute cmd.exe /C "C:\BatFiles\Log.bat";

Note: /C needs to be included as it is a parameter to cmd.exe.

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?