Once you have named and opened your app, you will get a screen where Qlik Sense asks you to load your data.
When you have this option before you, you can load data in several different ways. The easiest way is to drag and drop a spreadsheet or a file onto Qlik Sense, or to click on the Quick data load command and select the file in a file browser, as shown in the following screenshot:
This will open a file wizard where you can tweak the details of how the file should be loaded so that you get the data you want, as shown in the following screenshot:
You can specify file type, whether the file contains empty lines at the top (before the data starts), whether the first line contains the field names or not, and so on. Make sure you get all the settings right before you click on Load data.
Clicking on Load data will store your settings and load the data; if everything goes well, you will get the following dialog:
At this stage, you can either start to edit the sheet or you can load additional tables.
It is very common that the data you want to analyze is stored in several different tables, for example:
In a normal database, there are rules about where different entities are stored. For instance, everything about the customers should be stored in the Customers
table. If you need some information about a customer in another table, a unique customer identifier is stored in this table, which means that all the necessary data can be retrieved by a simple lookup in the Customers
table.
For the previously discussed case, the Order Lines
table will contain both the order ID and the product ID, and the Orders
table will contain the customer ID. This way, all four tables are linked logically, as shown in the following screenshot:
To obtain this data model in your app, you need to repeat the procedure for loading data that we had discussed previously for each additional table. You can either drag and drop a file onto Qlik Sense, or you can use the Quick data load command in the toolbar menu.
In the Quick data load process, you need to make sure that the key fields are named the same in all tables and that no other fields have the same name.
Either way, you will get a dialog asking you whether you want to add or replace data. You almost always want to add data. In this context, Replace data means that you remove all previously loaded data and replace it with the table you are about to load. These options are shown in the following screenshot:
This will take you to the familiar file wizard shown in the previous section, where you can define the file properties of the additional table.
On the screen where Qlik Sense asked you to load your data, there was a second option: Data load editor. Clicking on this option will open a new tab with a script editor, as shown in the following screenshot:
This editor is very similar to the QlikView script editor. It allows you to make very complex data transformations and basically load anything. However, as with all powerful tools, it is also easy to make mistakes. Use it with caution.
When you define your data using drag and drop or the Quick data load command, the data load sequence will be stored in the load script as one or several Load
statements. This means that these can be edited in Data load editor if you want to tweak them after they have been created.
You can also create your script from scratch using Data load editor. If so, you must first create your data connections. These can be file folders, connections to regular databases, or connections to other data sources using other connectors. This is how you do it:
If you want to create a database connection using Open Database Connectivity (ODBC), you should choose ODBC. This opens the ODBC connection dialog, where you can choose which data source to use:
The data sources that you see are the ones defined in the Windows operating system, which means that if you do the development on a server, the list is limited to those defined by the server administrator.
Once you have created these connections, you will have them displayed in a list of data connections, as shown in the following screenshot:
Each data connection has several icons: an icon to create a Load
or a Select
statement and a second one to edit the connection itself. In addition, database connections have a third icon that is used to create a Connect
statement.
Hence, to create a Load
statement, you should click on and find the file that contains the table. This way, you can create a script in very much the same way as you would in QlikView if you are familiar with it.
The goal is to create a script that defines a logical, coherent data model that corresponds to the business situation. When you have created the script, you need to run it to load the data. This is done by clicking on the Load data button in the toolbar of Data load editor.