File system access restriction
For security reasons, Qlik Sense in standard mode does not support paths in the data load script or functions and variables that expose the file system.
However, since file system paths were supported in QlikView, it is possible to disable standard mode and use legacy mode in order to reuse QlikView load scripts.
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.
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 | 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: Path using library connection | Supported input: Path using library connection or file system | The Include/Must_Include variable specifies a file that contains text that should be included in the script and evaluated as script code. It is not used to add data. 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. |
Regular script statements
Statement | Standard mode | Legacy mode | Definition |
---|---|---|---|
Binary | Supported input: Path using library connection | Supported input: Path using library connection or file system | The binary statement is used for loading data from another app. |
Connect | Supported input: Path using library connection | Supported input: Path using library connection or file system | 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 | Supported input: Path using library connection | Supported input: Path using library connection or file system | The Directory statement defines which directory to look in for data files in subsequent LOAD statements, until a new Directory statement is made. |
Execute | Not supported | Supported input: Path using library connection or file system | 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 ... | Supported input: Path using library connection | Supported input: Path using library connection or file system | The LOAD statement loads fields from a file, from data defined in the script, from a previously loaded table, from a web page, from the result of a subsequent SELECT statement or by generating data automatically. |
Store into ... | Supported input: Path using library connection | Supported input: Path using library connection or file system | The Store statement creates a QVD, CSV, or text file. |
Script control statements
Statement | Standard mode | Legacy mode | Definition |
---|---|---|---|
For each... filelist mask/dirlist mask |
Supported input: Path using library connection Returned output: Library connection |
Supported input: Path using library connection or file system Returned output: Library connection or file system 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 | Legacy mode | Definition |
---|---|---|---|
Attribute() | Supported input: Path using library connection | Supported input: Path using library connection or file system | Returns the value of the meta tags of different media files as text. |
ConnectString() | 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() |
Returned output: Library connection |
Returned output: Library connection or file system path, depending on input | The FileDir function returns a string containing the path to the directory of the table file currently being read. |
FilePath() |
Returned output: Library connection |
Returned output: Library connection or file system path, depending on input | The FilePath function returns a string containing the full path to the table file currently being read. |
FileSize() |
Supported input: Path using library connection |
Supported input: Path using library connection or file system | 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() |
Supported input: Path using library connection |
Supported input: Path using library connection or file system | The FileTime function returns a timestamp in UTC format of the last modification of a specified file. If a file is not specified, the function returns a timestamp in UTC of the last modification of the currently read table file. |
GetFolderPath() |
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() | Supported input: Path using library connection | Supported input: Path using library connection or file system | This script function returns the XML-header timestamp from a QVD file, if any is present, otherwise it returns NULL. In the timestamp, time is provided in UTC. |
QvdFieldName() | Supported input: Path using library connection | Supported input: Path using library connection or file system | This script function returns the name of field number fieldno in a QVD file. If the field does not exist NULL is returned. |
QvdNoOfFields() | Supported input: Path using library connection | Supported input: Path using library connection or file system | This script function returns the number of fields in a QVD file. |
QvdNoOfRecords() | Supported input: Path using library connection | Supported input: Path using library connection or file system | This script function returns the number of records currently in a QVD file. |
QvdTableName() | Supported input: Path using library connection | Supported input: Path using library connection or file system | This script function returns the name of the table stored in a QVD file. |
System functions
Function | Standard mode | 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. |