File system access restriction

For security reasons, Qlik Sense in standard mode does not support absolute or relative paths in the data load script or functions and variables that expose the file system.

However, since absolute and relative paths were supported in QlikView, it is possible to disable standard mode and use legacy mode in order to reuse QlikView load scripts.

Warning: Disabling standard mode can create a security risk by exposing the file system.

Disabling standard mode

Security aspects when connecting to file based ODBC and OLE DB data connections

ODBC and OLE DB data connections using file-based drivers will expose the path to the connected data file in the connection string. The path can be exposed when the connection is edited, in the data selection dialog, or in certain SQL queries. This is the case both in standard mode and legacy mode.

Tip: If exposing the path to the data file is a concern, it is recommended to connect to the data file using a folder data connection if it is possible.

Limitations in standard mode

Several statements, variables and functions cannot be used or have limitations in standard mode. Using unsupported statements in the data load script produces an error when the load script runs. Error messages can be found in the script log file. Using unsupported variables and functions does not produce error messages or log file entries. Instead, the function returns NULL.

There is no indication that a variable, statement or function is unsupported when you are editing the data load script.

System variables

Variable Standard mode / Qlik Sense Cloud Legacy mode Definition
Floppy

Not supported

Supported Returns the drive letter of the first floppy drive found, normally a:.
CD

Not supported

Supported Returns the drive letter of the first CD-ROM drive found. If no CD-ROM is found, then c: is returned.
QvPath

Not supported

Supported Returns the browse string to the Qlik Sense executable.
QvRoot

Not supported

Supported Returns the root directory of the Qlik Sense executable.
QvWorkPath

Not supported

Supported Returns the browse string to the current Qlik Sense app.
QvWorkRoot

Not supported

Supported Returns the root directory of the current Qlik Sense app.
WinPath

Not supported

Supported Returns the browse string to Windows.
WinRoot

Not supported

Supported Returns the root directory of Windows.
$(include=...) Supported input: Library connection Supported input: Library connection or absolute/relative path The Include/Must_Include variable specifies a file that contains text that should be included in the script and evaluated as script code. You can store parts of your script code in a separate text file and reuse it in several apps. This is a user-defined variable.

System variables

Regular script statements

Statement Standard mode / Qlik Sense Cloud Legacy mode Definition
Binary

Binary

Supported input: Library connection Supported input: Library connection or absolute/relative path The binary statement is used for loading data from another app.
Connect

Connect

Supported input: Library connection Supported input: Library connection or absolute/relative path The CONNECT statement is used to define Qlik Sense access to a general database through the OLE DB/ODBC interface. For ODBC, the data source first needs to be specified using the ODBC administrator.
Directory

Directory

Supported input: Library connection Supported input: Library connection or absolute/relative path The Directory statement defines which directory to look in for data files in subsequent LOAD statements, until a new Directory statement is made.
Execute

Execute

Not supported Supported input: Library connection or absolute/relative path The Execute statement is used to run other programs while Qlik Sense is loading data. For example, to make conversions that are necessary.
LOAD from ...

Load

Supported input: Library connection Supported input: Library connection or absolute/relative path Returns the browse string to the Qlik Sense executable.
Store into ...

Store

Supported input: Library connection Supported input: Library connection or absolute/relative path Returns the root directory of the Qlik Sense executable.

Script control statements

Statement Standard mode / Qlik Sense Cloud Legacy mode Definition

For each...

filelist mask/dirlist mask

For each..next

Supported input: Library connection

Returned output: Library connection

Supported input: Library connection or absolute/relative path

Returned output: Library connection or absolute path, depending on input

The filelist mask syntax produces a comma separated list of all files in the current directory matching the filelist mask. The dirlist mask syntax produces a comma separated list of all directories in the current directory matching the directory name mask.

File functions

Function Standard mode / Qlik Sense Cloud Legacy mode Definition
Attribute()

Attribute - script function

Supported input: Library connection Supported input: Library connection or absolute/relative path Returns the value of the meta tags of different media files as text.
ConnectString()

ConnectString - script function

Returned output: Library connection name Library connection name or actual connection, depending on input Returns the active connect string for ODBC or OLE DB connections.
FileDir()

FileDir - script function

Returned output: Library connection

Returned output: Library connection or absolute path, depending on input The FileDir function returns a string containing the path to the directory of the table file currently being read.
FilePath()

FilePath - script function

Returned output: Library connection

Returned output: Library connection or absolute path, depending on input The FilePath function returns a string containing the full path to the table file currently being read.
FileSize()

FileSize - script function

Supported input: Library connection

Supported input: Library connection or absolute/relative path The FileSize function returns an integer containing the size in bytes of the file filename or, if no filename is specified, of the table file currently being read.
FileTime()

FileTime - script function

Supported input: Library connection

Supported input: Library connection or absolute/relative path The FileTime function returns a timestamp for the date and time of the last modification of the file filename. If no filename is specified, the function will refer to the currently read table file.
GetFolderPath()

GetFolderPath - script function

Not supported

Returned output: Absolute path

The GetFolderPath function returns the value of the Microsoft Windows SHGetFolderPath function. This function takes as input the name of a Microsoft Windows folder and returns the full path of the folder.
QvdCreateTime()

QvdCreateTime - script function

Supported input: Library connection Supported input: Library connection or absolute/relative path This script function returns the XML-header time stamp from a QVD file, if any is present, otherwise it returns NULL.
QvdFieldName()

QvdFieldName - script function

Supported input: Library connection Supported input: Library connection or absolute/relative path This script function returns the name of field number fieldno, if it exists in a QVD file (otherwise NULL).
QvdNoOfFields()

QvdNoOfFields - script function

Supported input: Library connection Supported input: Library connection or absolute/relative path This script function returns the number of fields in a QVD file.
QvdNoOfRecords()

QvdNoOfRecords - script function

Supported input: Library connection Supported input: Library connection or absolute/relative path This script function returns the number of records currently in a QVD file.
QvdTableName()

QvdTableName - script function

Supported input: Library connection Supported input: Library connection or absolute/relative path This script function returns the name of the table stored in a QVD file.

System functions

Function Standard mode / Qlik Sense Cloud Legacy mode Definition
DocumentPath()

Not supported

Returned output: Absolute path

This function returns a string containing the full path to the current Qlik Sense app.
GetRegistryString()

 

Not supported

Supported Returns the value of a named registry key with a given registry path. This function can be used in chart and script alike.

System functions

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?