Skip to main content

Include

ON THIS PAGE

Include

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.

Note: This variable supports only folder data connections in standard mode.

Syntax:

$(Include=filename)

$(Must_Include=filename)

There are two versions of the variable:

  • Include does not generate an error if the file cannot be found, it will fail silently.
  • Must_Include generates an error if the file cannot be found.

If you don't specify a path, the filename will be relative to the Qlik Sense app working directory. You can also specify an absolute file path, or a path to a lib:// folder connection. Do not put a space character before or after the equal sign.

Note: The construction set Include =filename is not applicable.

Examples:  

$(Include=abc.txt);

$(Must_Include=lib://DataFiles/abc.txt);  

Limitations

Limited cross-compatibility between UTF-8 encoded files under Windows versus Linux.

It is optional to use UTF-8 with BOM (Byte Order Mark). BOM can interfere with the use of UTF-8 in software that does not expect non-ASCII bytes at the start of a file, but that could otherwise handle the text stream.

  • Windows systems use BOM in UTF-8 to identify that a file is UTF-8 encoded, despite the fact that there is no ambiguity in the byte storage.

  • Unix/Linux use UTF-8 for Unicode, but does not use the BOM as this interferes with the syntax for command files.

This has some implications for Qlik Sense.

  • In Windows any file that begins with an UTF-8 BOM is considered a UTF-8 script file. Otherwise ANSI encoding is assumed.

  • In Linux, the system default 8 bit code page is UTF-8. This is why the UTF-8 works although it does not contain a BOM.

As a result, portability cannot be guaranteed. It is not always possible to create a file on Windows that can be interpreted by Linux and vice versa. There is no cross compatibility between the two systems regarding UTF-8 encoded files due to different handling of the BOM.

For more information, see Byte order mark