Skip to main content Skip to complementary content
Close announcements banner

Selecting data from a database

In order to select data from a database, you start by clicking ± on an ODBC or OLE DB data connection in the data load editor. This is where you select the fields to load from the database tables or views of the data source. You can select fields from several databases, tables and views in one session.

Selecting database

Do the following:

  1. Select a Database from the drop-down list.
  2. Select Owner of the database.

The list of Tables is populated with views and tables available in the selected database.

Selecting tables and views

The table list will include tables, views, synonyms, system tables and aliases from the database.

If you want to select all fields of a table, do the following:

  • Mark the checkbox next to the table name.

If you want to select specific fields from a Table, do the following:

  • Click on the table name (not in the checkbox).

    Fields will be updated with the available table content, and you can continue by selecting fields.

Tables with all fields selected are indicated with a checkmark in the checkbox, while tables with some fields selected are indicated with a blue square in the checkbox and the number of selected fields to the right.

Selecting fields

Fields lists all fields available in the selected Table. You can Filter for fields in the list by typing part of the field name in the text box.

You can display the fields in either of the following views:

  • Data preview, which presents data in horizontal column layout and preview data loaded. Primary key fields are indicated by ®.
  • Metadata, which presents data in a vertical list layout with field metadata, such as primary keys and data type, displayed.

Do the following:

  • Select the fields you want to include using the checkbox next to each field name.

When you have selected the fields to include from the selected table, you can continue to select fields from other tables in the same database, or pick another database and select tables and fields from that database.

Selections summary provides an overview of the databases you have selected and the number of selected tables and fields.

Renaming fields

You can rename fields. This is particularly useful in the following two cases:

  • If you load two files containing a field with the same name, they will by default be linked and treated as one field in Qlik Sense. If you want to load them as separate fields, rename the fields so that they are different.
  • If you load two files containing a field that should be read as one field, but has different names in the respective files, you can rename them (in either file) to have identical names to load them as one field.
Information noteYou cannot rename fields in the data selection wizard at the same time as you filter for fields by searching. You have to erase the search string in the text box first.
Information noteIt is not possible to rename two fields in the same table so that they have identical names.

Do the following:

  • Click on the field header you want to rename, type the new name and press Enter.

The field is renamed, and the script preview is updated.

Information noteRenaming a field corresponds to using as in a field definition in a LOAD statement.
Information noteIf you rename fields in a table, a LOAD statement will be inserted automatically regardless of the Include LOAD statement setting.

Previewing script

The statements that will be inserted are displayed in the script preview, which you can choose to hide by clicking Preview script.

Including LOAD statement

If Include LOAD statement is selected, SELECT statements are generated with preceding LOAD statements using the SELECT statements as input.

Information noteIf you rename fields in a table, a LOAD statement will be inserted automatically regardless of this setting.

Inserting in the script

When you have finished selecting fields and want to generate your LOAD/SELECT statements in the script, do the following:

  • Click Insert script.

The data selection window is closed, and the LOAD /SELECT statements are inserted in the script in accordance with your selections.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!