Skip to main content

Connect to data sources in the data load editor

Data connections in the data load editor let you save shortcuts to the data sources you commonly use: databases, local files, or remote files.

Data connections lists the connections you have saved in alphabetical order grouped by the spaces to which they belong. You can use the search box to narrow the list down to connections with a certain name or type.

Note: You can only see data connections that you own, or have been given rights to access. Please contact your Qlik Sense system administrator to acquire access if required.

Creating a new data connection

Do the following:

  1. Click Create new connection.
  2. Select the type of data source you want to create from the drop-down list.

    The settings dialog, specific for the type of data source you selected, opens.

  3. Enter the data source settings and click Create to create the data connection.

Deleting a data connection

Do the following:

  1. Click Delete on the data connection you want to delete.
  2. Confirm that you want to delete the connection.

The data connection is now deleted.

Editing a data connection

Do the following:

  1. Click Edit on the data connection you want to edit.
  2. Edit the data connection details. Connection details are specific to the type of connection.

    You may need to provide the connection's credentials.

The data connection is now updated.

Note: If you edit the name of a data connection, you also need to edit all existing references (lib://) to the connection in the script, if you want to continue referring to the same connection.

About DataFiles connections

DataFiles connections are automatically created for each space you can access. The connections are available from each space section under Data Connections.

Note: The file extension of DataFiles connections is case sensitive. For example: .qvd.

Inserting a connect string

Connect strings are required for most connections. Only folder and web file connections do not require connect strings.

Do the following:

  • Click Insert into script on the connection for which you want to insert a connect string.

A connect string for the selected data connection is inserted at the current position in the data load editor.

Selecting data from a data connection

If you want to select data from a data connection to load in your app, do the following:

  1. Create new connection linking to the data source (if the data connection does not already exist).
  2. Data Selection Select data from the connection.

Referring to a data connection in the script

You can use the data connection to refer to data sources in statements and functions in the script, typically where you want to refer to a file name with a path.

The syntax for referring to a file is [lib://(space_name):(connection_name)/(file_name)]

You do not need to add the space_name if you are connecting to a personal space.

This example loads the file orders.csv from a personal space defined in the Data data connection.

LOAD * FROM [lib://DataFiles/orders.csv];

This example loads the file orders.csv from a shared space defined in the Data data connection.

LOAD * FROM [lib://TeamSharedConnection:DataFiles/orders.csv];

This example loads the file orders.csv from the current space. If the app is moved to another space, for example, it will use the file orders.csv in the new space.

LOAD * FROM [lib://:DataFiles/orders.csv];

This example loads the table Sales_data from the DataSource database connection in a user's personal space.

LIB CONNECT TO 'DataSource';
LOAD *;
SQL SELECT * FROM `Sales_data`;

Example: Loading from a database in another space

This example loads the table Sales_data from the DataSource database connection in the current space.

LIB CONNECT TO ':DataSource';
LOAD *;
SQL SELECT * FROM `Sales_data`;

Example: Loading from a database in a specific space

This example loads the table Sales_data from the DataSource database connection in the space SalesSpace.

LIB CONNECT TO 'SalesSpace:DataSource';
LOAD *;
SQL SELECT * FROM `Sales_data`;