Sie sind auf Seite 1von 52

Tutorial - Building an App

Qlik® Sense
1.1
Copyright © 1993-2015 QlikTech International AB. All rights reserved.
Copyright © 1993-2015 QlikTech International AB. All rights reserved.

Qlik®, QlikTech®, Qlik® Sense, QlikView®, Sense™ and the Qlik logo are trademarks which have been
registered in multiple countries or otherwise used as trademarks by QlikTech International AB. Other
trademarks referenced herein are the trademarks of their respective owners.
Contents

1 Welcome to this tutorial! 5


1.1 About this tutorial 5
1.2 Qlik Sense Desktop or Qlik Sense? 5
1.3 Installation of Qlik Sense Desktop 6
1.4 Placing the tutorial source files in the Sense folder 6
1.5 Further reading and resources 6
2 Building an app 7
2.1 Opening Qlik Sense Desktop 7
2.2 Opening Qlik Sense 7
3 Creating a new app 8
4 Loading data with the data load editor 9
4.1 Creating the ODBC data connection 9
4.2 Checking that the correct driver is installed 9
Download of an Access database engine 10
4.3 Installing the connector driver and creating the data source 10
4.4 Connecting to the database 12
4.5 Building the load script 13
4.6 Loading the data 15
4.7 Syntax check 16
Loading data from Item master.xlsx 17
The associative logic of Qlik Sense 18
5 Loading data with quick data load 21
5.1 Loading the data 22
Adding data from Item master.xlsx 22
The associative logic of Qlik Sense 23
6 Loading more data 26
Loading data from Region.txt 26
6.1 Adding data from the Sales rep.csv file 27
6.2 Loading the file Customers 31
Regional settings and master calendar 32
7 App design 35
7.1 Creating the sheets 35
8 The first sheet: Dashboard 38
8.1 Creating visualizations 38
8.2 Adding the filter panes 39
8.3 Adding the pie chart 39
8.4 Adding the bar chart 40
8.5 Adding the combo chart 41
8.6 Adding the text & image chart 41
8.7 Adding the gauge 42
8.8 Adding the line chart 43
9 The second sheet: Product Details 44

Tutorial - Building an App - Qlik Sense, 1.1 3


Contents

9.1 Adding the filter panes 44


9.2 Adding the bar chart 45
9.3 Adding the treemap 45
10 The third sheet: Customer Details 46
10.1 Adding filter panes 46
10.2 Adding the scatter plot 47
10.3 Adding the table Customer KPIs 47
Adjusting the number formatting 47
11 Data storytelling 49
11.1 Taking snapshots 49
11.2 Creating a simple story 49
Slide 1 50
Slide 2-4 51
Switching between data storytelling and the app context 52
Additional options 52
11.3 Thank you! 52

Tutorial - Building an App - Qlik Sense, 1.1 4


1   Welcome to this tutorial!

1 Welcome to this tutorial!


Welcome to this tutorial, which will introduce you to app building in Qlik Sense. Qlik Sense is a software
product that is used to extract and present data in an intuitive and easy-to-use interface. You extract data by
making selections in Qlik Sense. When you make a selection, the app immediately filters the data and
presents all associated items. If you want to learn more about selections, go through the Tutorial - Beginning
with the Basics that is available at help.qlik.com. In this tutorial, the focus is on app building.

1.1 About this tutorial


This tutorial guides you through the building of an app from scratch. You start with an empty sheet and finish
with a good-looking app!

It is assumed that you are familiar with the basics of Qlik Sense. You know how to make selections and how
to interpret the results of your selection.

These are some of the subjects in this tutorial:

l Data loading
l App design
l Visualization creation
l Reuse of visualizations, dimensions and measures
l Data storytelling

When you have completed the tutorial, you should have a fair understanding of the different steps involved in
the building of a Qlik Sense app. You will also be aware of some of the necessary considerations related to
the design of the app.

1.2 Qlik Sense Desktop or Qlik Sense?


Before you can start working with Qlik Sense, you either need to install Qlik Sense Desktop on your
computer, or have access to Qlik Sense on a server. If you can choose, we recommend that you download
Qlik Sense Desktop from www.qlik.com. It is free, and easy to install. The content in this tutorial reflects the
Qlik Sense Desktop user interface, and there are differences compared to Qlik Sense. However, you should
still be able to take the tutorial on Qlik Sense, if you get some support from your system administrator.

If you are using Qlik Sense, you may need help with some of the following:

l Accessing the hub.


l Storing the Tutorial source folder on the server machine.
l Ensuring that the server has the correct Access database engine installed.
l Loading data.

One of the differences between Qlik Sense Desktop and Qlik Sense is that the quick data load
alternative is not available on Qlik Sense.

Tutorial - Building an App - Qlik Sense, 1.1 5


1   Welcome to this tutorial!

1.3 Installation of Qlik Sense Desktop


You can download Qlik Sense Desktop from www.qlik.com. If you need help with the installation, you find
instructions at help.qlik.com.

1.4 Placing the tutorial source files in the Sense folder


The folder Tutorial source is included in the zip file, and before you begin this tutorial, you need to place the
source folder in the Sense folder. Open the folder Documents. (It is sometimes called My Documents.)
From there, the path is Qlik\Sense. Place the Tutorial source folder in the Sense folder.

1.5 Further reading and resources


Qlik offers a wide variety of resources when you want to learn more.

At help.qlik.com, you find the Qlik Sense online help and a number of downloadable guides.

If you visit www.qlik.com, you will find the following:

l Training, including free online courses


l Demo apps
l Qlik Community, where you will find discussion forums, blogs, and more

These are all valuable sources of information and are highly recommended.

Tutorial - Building an App - Qlik Sense, 1.1 6


2   Building an app

2 Building an app
Building an app involves some basic steps that you need to take to be able to design and use the app.

1. Creating an empty app.


Basically, what you do is to give the app a name.
2. Loading data in the data load editor.
Qlik Sense is built for analyzing data, and without any data the app is not very useful.
3. Creating one or more sheets and adding visualizations.
The sheet is where you create your visualizations. It is also where you analyze your data, when the
app is ready.

These are the basic steps. In more advanced apps, scripting often includes much more than just loading
data.

2.1 Opening Qlik Sense Desktop


If you have not already installed Qlik Sense Desktop, do so now.

When you have installed Qlik Sense Desktop, you start it from the shortcut on your desktop, the left pane in
the Start menu, or the Qlik Sense folder, under All Programs.

When you start Qlik Sense Desktop, you arrive at the hub. You can close the greeting message.

The hub is the storage of your apps. If you have installed Qlik Sense Desktop recently, you may not have
many apps yet, and in that case, you are about to begin building your first app!

2.2 Opening Qlik Sense


If you are using Qlik Sense, you start Qlik Sense by entering a web address in your browser, such as
https://<server name>/hub. The exact address depends on how Qlik Sense has been deployed in your
organization. When Qlik Sense has started, you arrive at the hub, where you can create a new app from My
work.

Tutorial - Building an App - Qlik Sense, 1.1 7


3   Creating a new app

3 Creating a new app


Your first step towards a complete app is to create an empty app.

Do the following:

1. In the hub, click Create new app.


The Create new app dialog opens.
2. Enter the name Tutorial for the app.
3. Click Create.
A creation confirmation is displayed.
4. Click Open app.
The app is opened in app overview.

In the app overview you are presented with two options to load data, Quick data load and Data load
editor. You now need to decide which of these options to use.

In this tutorial you will load the following files:

l Sales.accdb or Sales.xlsx
l Item master.xlsx
l Region.txt
l Sales rep.csv
l Customers.xlsx
l MasterCalendar.txt

If you only want to load data as quickly as possible so that you can get started with the app building, you
should choose the Quick data load option. Click Quick data load.

See: Loading data with quick data load (page 21)

If you want to learn how to load data from a Microsoft Access database and create an ODBC connection, you
should choose the Data load editor option. This option is a little more challenging, but also more rewarding,
especially if you need to know how to connect to database files. Click Data load editor and proceed to the
next chapter.

Tutorial - Building an App - Qlik Sense, 1.1 8


4   Loading data with the data load editor

4 Loading data with the data load editor


Once you have created your app, you need to load data into it. In this chapter, you will load data through the
data load editor.

You can connect to and retrieve data from various data sources. In the script, you specify the fields and
tables to load. With the load script, you can use data from multiple data sources and compile the data into a
single Qlik Sense app.

4.1 Creating the ODBC data connection


The first file to load is the Access database file Sales.accdb. Before you can load the data you must create a
data connection.

Creating a data connection involves three steps:

1. Installing a driver for the connector.


2. Creating an ODBC data source for the database you want to connect to.
3. Connecting to the database.

You will load the data from the Access database file into Qlik Sense through an Open Database Connectivity
(ODBC) connector. To be able to use the ODBC connector, you must first install a driver to support your
database management system. Then you need to add and configure an ODBC data source, and finally
connect to the database.

Should you run into difficulties that prevent you from setting up the database connection, you
can jump to the next chapter and instead load data through the Quick data load. (The quick
data load option is not available on Qlik Sense.)

4.2 Checking that the correct driver is installed


To be able to load the Sales.accdb database file you must have a driver that supports that file format. You
need to check whether the necessary driver is installed.

Do the following:

1. Navigate to and open the file %systemdrive%\Windows\SysWOW64\odbcad32.


With a local installation of Qlik Sense, C: is your system drive.

You must navigate to the file instead of searching for it. If you search for odbcad32, you
will be presented with the wrong file.

Tutorial - Building an App - Qlik Sense, 1.1 9


4   Loading data with the data load editor

2. Open the tab Drivers.


a. If the list includes Microsoft Access Driver(*.mdb, *.accdb), the correct drivers are already
installed.
b. If the list does not include Microsoft Access Driver(*.mdb, *.accdb), you need to download
an Access database engine.

Download of an Access database engine


If you have a 64-bit version of Office 2010 installed you must install the 2007 Access database engine.

If you do not have the 64-bit version of Office 2010, you can install the 2010 Access database engine.

If you do not have any version of Office installed (neither 2007 nor 2010), you must install the 2007 Access
database engine.

Refer to the Microsoft Download Center for details.

4.3 Installing the connector driver and creating the data


source
You install the connector driver through the ODBC data source administrator.

Do the following:

1. Navigate to the folderSysWOW64: %systemdrive%\Windows\SysWOW64.


2. Locate and open the file odbcad32.
3. Under User DSN, click Add to open the Create New Data Source dialog.

Tutorial - Building an App - Qlik Sense, 1.1 10


4   Loading data with the data load editor

4. Select Microsoft Access Driver (*.mdb, *.accdb).

5. Click Finish.
6. In the ODBC Microsoft Access Setup dialog type Tutorial ODBC as the Data Source Name.
7. Under Database, click Select.

Tutorial - Building an App - Qlik Sense, 1.1 11


4   Loading data with the data load editor

8. Under Directories, navigate to the location of your Sales.accdb file.

9. When the file Sales.accdb is visible in the list below the Database Name text box, click
Sales.accdb.
Sales.accdb becomes the database name.
10. Click OK twice.
11. Verify that Tutorial ODBC has been added to the User Data Sources.
12. Click OK.

4.4 Connecting to the database


Now it is time to connect to the database.

Do the following:

1. Return to the Qlik Sense data load editor.


2. In the upper right-hand corner, click Create new connection and select ODBC from the list.
3. In the Create new connection (ODBC) dialog, select User DSN.
4. In the list that is displayed, select Tutorial ODBC.
5. Select Use 32-bit connection.
The dialog should look as follows:

Tutorial - Building an App - Qlik Sense, 1.1 12


4   Loading data with the data load editor

6. Save the connection.

The data connection Tutorial ODBC is available under Data connections to the right.

4.5 Building the load script


The next step is to start building the load script. You select what table content you want to load.

Do the following:

1. Put the cursor two rows below the last SET statement.

2. In the Tutorial ODBC data connection to the right, click ± to select data.


The data selection window is opened.
3. Under Tables, locate and select Sales.
4. If MSysAccessStorage (at the top of the Tables list) is selected, clear the selection. You do not need
that data.

Tutorial - Building an App - Qlik Sense, 1.1 13


4   Loading data with the data load editor

5. Click Insert script.


The script should look as follows. (The regional settings SET statements are not shown.)

Tutorial - Building an App - Qlik Sense, 1.1 14


4   Loading data with the data load editor

4.6 Loading the data


Do the following:

1. In the upper right-hand corner, click Load data.


A data load progress window is displayed. When the data load is complete, a confirmation is
displayed.
2. Close the confirmation window.

3. Click ” and select Data model viewer to verify that your data is loaded.
4. In the data model viewer, click s to expand the table.
5. Click Save.

Tutorial - Building an App - Qlik Sense, 1.1 15


4   Loading data with the data load editor

The table in the data model viewer should look like the following image. If your table is not displayed, or has
fewer fields, you can either go through the script and compare it with the script example, or remove the
existing load script and go through the procedure of building the script again.

4.7 Syntax check


If anything is wrong or missing, you can either make the changes directly in the script, or you can remove the
script and go through the script building procedure again.

When you make changes in the script manually, you must follow the scripting rules (syntax), otherwise you
will get a load error. In the script, you can see that all field names that have more than one word, have
quotation marks surrounding them. If you tried to load such a field without quotation marks, you would get a

Tutorial - Building an App - Qlik Sense, 1.1 16


4   Loading data with the data load editor

load error. The same is true for the comma that ends each row. All rows with fields to be loaded must be
ended with a comma, except the row with the last field, which on the contrary must not be ended with a
comma.

It is easy to forget a comma or a quotation mark when you work with a script. Therefore, it is a good idea to
start to search for such errors when you get a load error. A syntax check is performed when you run the script.
If you get a syntax error, the editor highlights the location where the error is detected, but the cause of the
error can be one or more rows earlier.

Loading data from Item master.xlsx


The next file to load data from is Item master.xlsx.

Do the following:

1. Click ” and select Data load editor.


2. Click ¨ and select Quick data load.
A dialog is displayed with options to add data or replace data.
3. Select Add data.
A file selection window is displayed.
4. Navigate to and open the Tutorial source folder. (The recommendation was to store the folder under
Documents in /Qlik/Sense.)
5. Select the file Item master.xlsx.
The data selection window is opened.

Tutorial - Building an App - Qlik Sense, 1.1 17


4   Loading data with the data load editor

6. In the Fields section, verify that the field names are displayed properly. If they are not, select
Embedded field names under Field names.
7. Click Load data.
LOAD statements for all the fields are inserted into a new section in the data load editor.

The new addition to the script should look as follows.

Under Data connections, you can see that a new connection has been created: Tutorial source. This
connection was created automatically when you loaded data through the Quick data load.

The associative logic of Qlik Sense


In the data load editor, click Load data. When the data has been loaded, click ” and select Data model
viewer.

Tutorial - Building an App - Qlik Sense, 1.1 18


4   Loading data with the data load editor

In the toolbar, click s to expand the tables. In the following screenshot the tables have been rearranged for
clarity, but the content in your tables should be the same.

The two tables have been connected. If you have two tables listing different things, for example, one table of
customers and one of invoices, and the two tables have a field (column) in common, for example, the
customer number, this usually means that there is a relation between the two tables. (In your data model, the
field in common is Item Number.)

If such a relationship exists, associations are made between the fields that are common to the tables; Qlik
Sense assumes that the two fields are one and the same thing, and the two fields are treated as one. Such a
field connecting two or more tables is called a key.

There are two basic rules for associations:

l For two fields to be associated, they need to have exactly the same name. The comparison is case
sensitive, so the fields Customer and customer are not the same and will not be associated.

Tutorial - Building an App - Qlik Sense, 1.1 19


4   Loading data with the data load editor

l If a certain field has exactly the same value in several different input tables, Qlik Sense treats it as
one value and also assumes that the records (rows) containing the value should be associated. For
two field values to be associated, they need either of the following:
l exactly the same spelling (case sensitive)
l exactly the same numeric value

Consequently, Customer and customer are not the same and are not associated, but the numbers 123 and
00123 are the same and are associated.

The next chapter is only for those who load the sales data through the Excel file Sales.xlsx. You can proceed
to Loading more data (page 26).

Tutorial - Building an App - Qlik Sense, 1.1 20


5   Loading data with quick data load

5 Loading data with quick data load


When you select the Quick data load option, a file selection dialog is displayed. You now need to navigate
to the Tutorial source folder with all the data files that you will load. If you followed the previous
recommendation to place the Tutorial source folder under Documents > Qlik, you can scroll down and
select the Qlik folder in the dialog, and then select the folder Tutorial source to view the data files. If you
stored the Tutorial source folder somewhere else, you need to navigate to the folder location and open the
folder.

File selection dialog where no file is selected

Tutorial - Building an App - Qlik Sense, 1.1 21


5   Loading data with quick data load

You will load all the files in the folder, except MasterCalendar.txt, which is a special case. Begin with the file
Sales.xlsx.

5.1 Loading the data


It is good practice to load the most important file first, which in this case is Sales.xlsx.

Do the following:

1. In the file selection dialog, select the file Sales.xlsx.


A data selection window is displayed.

2. Sales is already selected and the headings under Fields look correct. You only have to click Load
data.
A progress window is displayed and then a confirmation of a successful data load.
3. Click Close.

You are now in app overview. This is where you see all the sheets in your app. It is on the sheets that you
create your visualizations. But before you begin to design the sheets, you will load more data.

Adding data from Item master.xlsx


The next file to load data from is Item master.xlsx.

Do the following:

1. In the toolbar, click ¨ and select Quick data load.


A dialog is displayed with options to add data or replace data.

Tutorial - Building an App - Qlik Sense, 1.1 22


5   Loading data with quick data load

2. Select Add data.


The file selection dialog is displayed.
3. Select the file Item master.xlsx.
A data selection window is displayed.

4. The table Item master is already selected, but in the Fields section, you can see that the field
headings are not displayed properly. In the Field names list, select Embedded field names to
correct this.
5. Click Load data.
The data is loaded and a confirmation is displayed.
6. Click Close.

The associative logic of Qlik Sense


Let us have a look at the data model viewer and the files that have been loaded so far.

Do the following:

1. In the toolbar, click ” and select Data model viewer.


2. In the toolbar in the data model viewer, click s to expand the tables.

For the sake of clarity, the tables have been rearranged, but you should have the same content in your tables.

Tutorial - Building an App - Qlik Sense, 1.1 23


5   Loading data with quick data load

The two tables have been connected. If you have two tables listing different things, for example, one table of
customers and one of invoices, and the two tables have a field (column) in common, for example, the
customer number, this usually means that there is a relation between the two tables. (In your data model, the
field in common is Item Number.)

If such a relationship exists, associations are made between the fields that are common to the tables; Qlik
Sense assumes that the two fields are one and the same thing, and the two fields are treated as one. Such a
field connecting two or more tables is called a key.

There are two basic rules for associations:

l For two fields to be associated, they need to have exactly the same name. The comparison is case
sensitive, so the fields Customer and customer are not the same and will not be associated.
l If a certain field has exactly the same value in several different input tables, Qlik Sense treats it as
one value and also assumes that the records (rows) containing the value should be associated. For
two field values to be associated, they need either of the following:

Tutorial - Building an App - Qlik Sense, 1.1 24


5   Loading data with quick data load

l exactly the same spelling (case sensitive)


l exactly the same numeric value

Consequently, Customer and customer are not the same and are not associated, but the numbers 123 and
00123 are the same and are associated.

Tutorial - Building an App - Qlik Sense, 1.1 25


6   Loading more data

6 Loading more data


When working with Qlik Sense Desktop, you need to save your changes to the data model before leaving the
page, or else your changes will be lost.

A couple of more files to load before you can start working with the visualizations.

Loading data from Region.txt


The next source to load data from is the Region.txt file with a slightly different data selection interface.

Do the following:

1. In the toolbar, click ¨ and select Quick data load.


A dialog is displayed with options to add data or replace data.
2. Select Add data.
3. Select the file Region.txt.
The data selection window is opened.

4. As you can see in the preview, the field names need to be recognized. In the Field names list, select
Embedded field names.
5. Click Load data.

6. Click ” and select Data model viewer.

The new addition to the data model viewer should look as follows:

Tutorial - Building an App - Qlik Sense, 1.1 26


6   Loading more data

7. The Region table is not connected to any other table, because there are no fields to associate to. The
table Region does not have any fields in common with the other tables. A field does not necessarily
have to connect to other tables, it can still be useful. It may also be that one of the source files that
remains to be loaded can contain a field that connects to the Region table.
Furthermore, you can in many cases also create a connection in the load script to achieve a
connection that you would like to have.

6.1 Adding data from the Sales rep.csv file


The next file to load data from is Sales rep.csv.

Tutorial - Building an App - Qlik Sense, 1.1 27


6   Loading more data

Do the following:

1. In the toolbar, click ¨ and select Quick data load.


A dialog is displayed with options to add data or replace data.
2. Select Add data.
3. Select the file Sales rep.csv.
The data selection window is opened.
4. In the Field names list, select Embedded field names.
The Delimiter field is set to Semicolon, and that is correct. Qlik Sense automatically recognizes the
delimiter and by default displays the data with the correct delimiter.

5. Click Load data.


6. Close the data load confirmation.

After some rearrangement, the data model looks as follows:

Tutorial - Building an App - Qlik Sense, 1.1 28


6   Loading more data

The table Sales rep is not associated to any other table. Whereas more peripheral tables may exist on their
own, you would expect an important table as Sales rep to be associated to Sales so that it is possible to see
the relation between sales and a certain sales representative. Since the tables are not associated, they do
not have any field in common, but that does not necessarily mean that there is no potential association. It
may be that the same type of field exists in both tables, although with different names. If you compare the
fields in Sales rep with the fields in Sales, you can see that there are no fields that seem to correspond to the
manager fields, nor is there anything related to Path. Sales Rep Name 1/2/3 are pretty close to Sales Rep
Number, but Sales Rep ID may be an even better match. It is very important that the associations between
the tables are correct, otherwise the app will show incorrect values.

If you open the Excel source files Sales.xlsx and Sales rep.csv and compare the fields Sales Rep Number
and Sales Rep ID, you will see that both contain three-digit values between 103 and 185. It is reasonable to
assume that the fields contain the same type of data - identification of the sales representatives. If this
situation occurs when working with real data, it is strongly recommended that you get a confirmation that the
two fields really correspond to each other. Let us say that it has been confirmed that the fields Sales Rep
Number and Sales Rep ID correspond. Then you need to associate the two fields. The way to do it is to
rename one of the fields so that it matches the other one. You could of course do this in the Excel source file,
but that may have undesired consequences, because that file could be used in other contexts where it is
important that the field name remains unchanged. A better solution is to make the change in the script that
will only affect this app.

Tutorial - Building an App - Qlik Sense, 1.1 29


6   Loading more data

Do the following:

1. Click ” and open the data load editor.


2. Open the section for Sales rep.csv and locate the row with "Sales Rep ID".
3. Copy and add the following string, with the same capitalization, at the end: as "Sales Rep Number".
The string should now look as follows:
"Sales Rep ID" as "Sales Rep Number"

You must not use any comma at the end of the row, because it is the last row before the FROM
statement.

In the toolbar, click Load data. When the data has been loaded, close the confirmation window. Click ”
and select Data model viewer. The data model now looks as follows.

Now you have an association between the tables Sales rep and Sales! The field Sales Rep Number in Sales
rep was previously Sales Rep ID, but by changing the field name, you managed to create an association
between the two fields in the tables.

Tutorial - Building an App - Qlik Sense, 1.1 30


6   Loading more data

Although it is more common to want to create an association between two fields with different
names, you may also run into the opposite problem: two fields with the same name, but with
content that should not be associated. If you have the field Date both in a table called Invoices
and in another table called Orders, you do not want to have an association between the fields
since they refer to different things. The invoice date is not the same as the order date. A good
solution would be to rename both Date fields to avoid any confusion about which Date it is. The
fields could be renamed InvoiceDate and OrderDate.

6.2 Loading the file Customers


You load the data for Customers just like before. Use the quick data load to add the new data. Remember to
check the headings.

The data model viewer should now have the following content.

The data from Customers has been added, and now the table Region is no longer isolated. The table
Region and the table for customer data have a field in common: Region Code,which thereby becomes a key.

Tutorial - Building an App - Qlik Sense, 1.1 31


6   Loading more data

Now, all tables are associated, and not only that, they have single associations, which is good. When you
load data, you may sometimes get data models with undesirable associations. Synthetic keys and circular
references are two different results of (normally) undesirable associations. It is beyond the scope of this
tutorial to cover these topics, but it is good to know that these exist and that they need to be investigated to
ensure that no ambiguity is introduced through synthetic keys or circular references. Refer to the online help
for more information.

Looking again at the data model, there is still a possible improvement, a table title. The customer data of
table does not have a proper title. It is called Sheet1, which is not very informative. The remedy is to edit the
script so that the title is displayed.

Do the following:

1. Click ” and select Data load editor.


2. In the left panel, click the section Customers.xlsx to open the script for the Customers table.

With a larger script you can use the search function (F) to find what you are looking
for. Search for a field that is unique for that table, or the source file name.

3. Put the cursor to the left of the LOAD statement in line 1 and press Enter to create a new empty row.
4. On the empty row, enter the following string (including the colon):
Customer:
5. Click Load data.
6. Close the confirmation window.

The customer table now has the correct title. You can remain in the data load editor for the final steps before
you start working with the visualizations.

Regional settings and master calendar


Date and time formats can sometimes be quite tricky. By changing the regional settings and using a master
calendar, you reduce the risk of having trouble with the time and data formats. The regional settings and the
master calendar do not contain regular data that you load, but script data. You will copy the regional settings
and the content of the master calendar file to the script in the data load editor.

Do the following:

1. In the left panel, click Main to go to the existing regional settings.


2. Delete the existing regional settings (they all begin with SET) and copy and paste the following
regional settings at the top in the data load editor.

Tutorial - Building an App - Qlik Sense, 1.1 32


6   Loading more data

SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

You should now have 10 SET statements at the beginning of the script.

3. In the left panel, click P to create a new section.


A new section is created, and the temporary name Section highlighted.
4. Change the section name to Master calendar.
5. Copy the following lines and paste them into the new section.
LET varMinDate = NUM(PEEK('Date',0,'Sales'));
LET varMaxDate = NUM(PEEK('Date',-1,'Sales'));
TempCalendar:
LOAD
DATE($(varMinDate) + ROWNO() -1) AS TempDate
AUTOGENERATE $(varMaxDate) - $(varMinDate) +1;
// Create the Master Calendar
MasterCalendar:
LOAD
DATE(TempDate) AS Date,
WEEK(TempDate) AS Week,
YEAR(TempDate) AS Year,
MONTH(TempDate) AS Month,
DAY(TempDate) AS Day,
INYEARTODATE(TempDate,'2014-03-31', 0) *-1 AS CYTDFlag,
INYEARTODATE(TempDate,'2013-03-31',0) *-1 AS LYTDFlag,
DATE(MONTHSTART(TempDate), 'MMM-YYYY') AS MonthYear,
'Q' & CEIL(MONTH(TempDate)/3) AS Quarter,
WEEK(TempDate)&'-'&YEAR(TempDate) AS WeekYear,
WEEKDAY(TempDate) AS WeekDay
RESIDENT
TempCalendar
Order BY
TempDate ASC;
DROP FIELD TempDate;

Tutorial - Building an App - Qlik Sense, 1.1 33


6   Loading more data

6. Use the handle (o) to drag the section Master calendar to the bottom of the list.
7. Click Load data.
8. Close the confirmation window.

You have finished loading data and can start building your app.

Tutorial - Building an App - Qlik Sense, 1.1 34


7   App design

7 App design
You have loaded the data. Now it is time to create the user interface. User interface design involves using the
right objects in the right way, and making the sheets well structured and user-friendly. This app will be fairly
simple, but you will learn some basic design principles that are good to know. If you want to build an app of
your own, and want some inspiration, you should visit the Qlik web site. There you find a large number of
apps serving a wide variety of different purposes. If you are looking for something that could function as
template when you want to design your own app, chances are pretty good that you can find something useful.

7.1 Creating the sheets


The app that you are building will contain three sheets: Dashboard, Product Details, and Customer Details.
Click ” and select App overview, where you create new sheets and arrange your existing sheets.

Click Create new sheet and name the sheet Dashboard. Do the same for the sheets Product Details and
Customer Details. You now have three sheets that all belong to the same app, Tutorial.

The following screen shots show what the app will look like when it is finished.

Tutorial - Building an App - Qlik Sense, 1.1 35


7   App design

Tutorial - Building an App - Qlik Sense, 1.1 36


7   App design

As you can see there are similarities between the sheets. Filter panes with time, place, and managers are to
the left in all the sheets. It is good to strive towards consistency when you design an app. Visualizations that
are present in several sheets should have the same position in all sheets so that the user knows where to find
them. There should be a logic in the design that supports the users in achieving their goal, that is, making
data discovery. So, placement is one aspect of the design, another is the choice of visualization. Each
visualization has its own advantages, and to be able to build an efficient and well-functioning app, you need
to be aware of those advantages. To some extent the visualizations are self-explanatory. Graphical elements
are great for giving overviews and showing trends, whereas tables are economical in that they can present
large amounts of data using a limited space.You get exact figures, but lose the quick and easily digestible
information that is conveyed in graphical elements.

Tutorial - Building an App - Qlik Sense, 1.1 37


8   The first sheet: Dashboard

8 The first sheet: Dashboard


Click Dashboard to open the first sheet. The sheet is empty, but it will not be for long. Click @Edit to open
the assets panel to the left and the properties panel on the right. The assets panel has three tabs at the top:
5 (Charts), - (Fields), and é (Master items). Charts is open so that you can start adding charts to
the sheet.

The assets panel and the properties panel have a show/hide functionality in the bottom left and
right corners. Click h to switch between showing and hiding the panel.

8.1 Creating visualizations


The purpose of a dashboard is to give a quick overview of the current state of affairs. The focus is on sales
trends and figures. The dashboard is not primarily designed for data exploration, but it is of course possible to
make selections and analyze the results.

The screenshot for the sheet Dashboard shows the sheet when editing. To the left there are two filter panes,
the time filter pane without a title and Region. You will begin with these.

Tutorial - Building an App - Qlik Sense, 1.1 38


8   The first sheet: Dashboard

Drag the charts to the center of the area where you want to place them.

8.2 Adding the filter panes


Do the following:

1. Drag a filter pane to the sheet.


2. Click Add dimension and scroll to the bottom of the list to add the field Year.

3. At the top of the assets panel to the left, click - to open Fields.
4. Scroll down in the list to Quarter and drag the field to the center of the filter pane.
5. Drag the field Month to the filter pane.
6. Add the field Week in the same way.
7. Use the handles to resize the filter pane according to the screenshot.
8. Right-click the filter pane and select Add to master items.
9. Type the name Period and click Add.

You have created a filter pane and saved it as a master item which facilitates reuse.

The second filter pane only contains one dimension, Region.

Do the following:

1. At the top of the assets panel, click 5 to open Charts and drag a filter pane to the sheet.
2. Click Add dimension and scroll down and select the field Region.
3. Use the handles to resize the filter pane according to the screenshot.
4. Right-click the filter pane and select Add to master items.
5. Type the name Region and click Add.

The two filter panes are complete. In the toolbar above the sheet, click Save.

8.3 Adding the pie chart


Let us begin with the pie chart.

Do the following:

1. At the top of the assets panel, click 5 to open Charts and drag a pie chart to the sheet.
2. Click Add dimension and scroll to the bottom of the list to add the field Region.

3. In the assets panel to the left, click - to open Fields.


4. Locate the field Sales, right-click it and select Create measure.
5. In the Create new measure dialog, in the Expression box, add Sum in front of (Sales) to create the
measure Sum(Sales).

Tutorial - Building an App - Qlik Sense, 1.1 39


8   The first sheet: Dashboard

6. Click Create.
The measure is added as a master item.
7. Drag the new measure Sales to the center of the pie chart.
8. Use the handles to resize the pie chart according to the screenshot.
9. In the properties panel to the right, click Appearance > Presentation and select Donut.
10. Still in the properties panel, click Colors and legend.
11. Click the Colors button and select By measure in the list.
12. At the top of the visualization, add the title Sales per Region.

The donut pie chart is complete. The colors in the pie chart are by measure, which means the higher the
value, the darker the color. You have many options when it comes to coloring the values. Just remember that
the colors should serve a purpose and not be used just to make the visualization more colorful.

8.4 Adding the bar chart


The next visualization is a bar chart with the top five customers.

Do the following:

1. In Charts in the assets panel, drag a bar chart to the sheet. Place it under the pie chart.
2. Click Add dimension and scroll down and select the field Customer.
3. Click Add measure and under Measures, select Sales.
4. Right-click the bar chart and select Flip in the shortcut menu.
The bars are displayed horizontally.
5. In the properties panel to the right, click Dimensions > Customer to open the dimension.
6. In the list Limitation, select Fixed number.
7. The default setting is to display the top 10. Change the number to 5.
8. Clear the selection Show others.
9. In the properties panel, click Appearance > Y-axis:Customer.
10. Under Labels and title, select Labels only.
11. Click X-axis:Sales.
12. Under Labels and title, select Labels only.
13. Resize the bar chart according to the screenshot.
14. At the top of the visualization, add the title Top 5 Customers.

The bar chart is complete. You have created a bar chart showing the top five customers. When you make
selections in other visualizations, these customers will change, accordingly. If you had not cleared the
selection Show others, the fifth bar would have been gray, summarizing all the sales values where the
company name is missing. This value can be useful to get an understanding of how much of the sales that
cannot be referred to a specific company.

In the toolbar above the sheet, click Save.

Tutorial - Building an App - Qlik Sense, 1.1 40


8   The first sheet: Dashboard

8.5 Adding the combo chart


The combo chart combines a bar chart and a line chart and is especially useful when you want combine
values that are normally hard to combine because of their different scales.

Do the following:

1. Click Charts and drag a combo chart to the sheet. Place it under the bar chart.
2. Click Add dimension and select the field MonthYear.
3. Click Add measure and under Measures, select Sales.

4. At the top of the assets panel to the left, click é to open Master items.
5. Under Measures, click Create new.
6. Copy and paste the following string into the Expression box: 
(Sum(Sales) - Sum(Cost)) / Sum(Sales)
7. Type the name Margin and click Create.
The new measure is added to the list of master item measures.
8. Drag the measure Margin to the combo chart.
9. Select to add Margin as a line.
10. Under Number formatting, select Number, and in the Formatting list that is displayed, select 12%
11. Resize the combo chart according to the screenshot.
12. At the top of the visualization, add the title Sales Trend.

The combo chart is complete. The two measures Sales and Margin have one axis each, which enables the
combination of two totally different scales. The primary axis to the left is used for Sales and the secondary
axis to the right is used for Margin in percent.

8.6 Adding the text & image chart


The text & image visualization offers options to add text, images, links and measures. In this tutorial, you will
add two key KPI values for margin and sales.

Do the following:

1. Click Charts and drag a text & image chart to the sheet. Place it to the right of the pie chart.
2. In the properties panel to the right, click Add measure.
3. Copy and paste the following string into the text box where the cursor currently is: 
='$'&Round(Sum(Margin)/1000000, 0.1) & 'M'
4. Press Enter.
5. Under Label, change the title to Total Margin.
6. Once more, in the properties panel, click Add measure.
7. Copy and paste the following string into the text box where the cursor currently is: 
='$'&Round(Sum(Sales)/1000000, 0.1) & 'M'

Tutorial - Building an App - Qlik Sense, 1.1 41


8   The first sheet: Dashboard

8. Press Enter.
9. Under Label, change the title to Total Sales.
10. In the text & image chart, position the cursor to the left of the measures and type Total Margin:.
11. Use the right arrow key to jump to the next measure and type Total Sales:.
12. Press Ctrl+A and change the font size to XL.
13. If you need to separate the two values so that they are on one row each, position the cursor after Total
Margin: and press Enter.
14. Resize the text & image chart according to the screenshot.

The text and image chart is complete. You have added two expressions that include both text and measures.
The function Round () is used to reduce the number of decimals. In the toolbar above the sheet, click Save.

8.7 Adding the gauge


The gauge is used to visualize a single measure. Just like with the text & image chart, you do not make any
selections in the gauge.

Do the following:

1. In the assets panel, click 5 to open Charts.


2. Drag a gauge chart to the sheet and place it to the right of the text & image visualization.
3. In the properties panel to the right, click Add measure.
4. Select the measure Margin.
5. Under Number formatting, select Number, and in the Formatting list that is displayed, select
12%.
6. Under Appearance > Presentation, select Bar to present the gauge as a bar.
7. In the Range limits just above, set Min to -0.5 and Max to 0.5.
8. Still under Presentation, select Use segments.
9. Click Add limit.
10. In the text box that is displayed, enter 0.12, which sets the limit between the left and right segment to
12%.
11. Press Enter.
12. Click the left segment (dark blue) and select the red color.
13. Click the right segment (light blue) and select the green color.
14. At the very bottom of the properties panel, open Measure axis.
15. In Labels and title, select Labels only.
16. Resize the gauge according to the screenshot.
17. At the top of the visualization, add the title Profit Margin.

The gauge is complete and displays a large profit margin. The different gauge colors support the
interpretation of the value. Red is worrying, whereas green is good.

Tutorial - Building an App - Qlik Sense, 1.1 42


8   The first sheet: Dashboard

8.8 Adding the line chart


The line chart will be used to show the quarterly sales trend for the years 2012-2014. The figures for 2014 are
for the first half of the year.

Do the following:

1. At the top of the assets panel, click 5 to open Charts and drag a line chart to the sheet.
2. Click Add dimension and scroll down to select the field Quarter.
3. Click Add measure and select Sales from the list Measures.
4. In the properties panel to the right, under Dimensions, click Add dimension.
5. Scroll down to select Year.
6. In the properties panel, under Appearance > Presentation, select Show data points.
7. Under Colors and legend, click the Show legend button to set it to Auto.
8. At the top of the visualization, add the title Quarterly Trend.

You have completed the first sheet. In the top right corner, click ë to move to the sheet Product Details.

Tutorial - Building an App - Qlik Sense, 1.1 43


9   The second sheet: Product Details

9 The second sheet: Product Details


This sheet focuses on the products.

Product Details sheet when editing

9.1 Adding the filter panes


It is a good thing that you saved the Period filter pane as a master item, because now you can reuse it. And
that is true for the Region filter pane too.

Do the following:

1. In the assets panel, click é to open Master items.


2. Click Visualizations.
3. Drag the filter pane Period to the sheet and resize it according to the screenshot.
4. Drag the filter pane Region to the area below Period and resize it in the same manner.

Tutorial - Building an App - Qlik Sense, 1.1 44


9   The second sheet: Product Details

9.2 Adding the bar chart


Do the following:

1. In the assets panel, click 5 to open Charts.


2. Drag a bar chart to the sheet and place it to the right of the Period filter pane.
3. Click Add dimension and select the field Product Group.
4. Click Add measure and select Sales from the list Measures.

5. In the assets panel, click é to open Master items.


6. Click Measures.
7. Click Create new and type Sum(Margin) in the Expression box.
8. Type the name Margin and click Create.
Margin is added to the master item measures.
9. Drag the measure Margin to the bar chart and select to add it to the bar chart.
10. Resize the bar chart according to the screenshot.
11. Copy the following string, and paste it as a title for the bar chart:
='Total Sales: $'& Round(Sum(Sales)/1000000, 0.1) & 'M'

The bar chart is complete. By default, the measures are grouped when you add a second measure to a bar
chart.

9.3 Adding the treemap


Treemaps are used to show hierarchical data. In this treemap you will create a product hierarchy.

Do the following:

1. In the assets panel, click 5 to open Charts.


2. Drag a treemap to the empty space on the sheet.
3. Click Add dimension and select the field Product Group.
4. Click Add measure and select Sales from the list Measures.
5. In the properties panel to the right, under Dimensions, click Add dimension.
6. In the list, select Product Type.
7. Click Add dimension again and select Item Desc.
8. Under Appearance > Colors, click the Colors button.
9. Select By measure in the list.
10. Resize the treemap according to the screenshot.
11. Add the title Product Treemap to the visualization.

The treemap and sheet are complete. The next sheet is the final one. In the top right corner, click ë to
move to the sheet Customer Details.

Tutorial - Building an App - Qlik Sense, 1.1 45


10   The third sheet: Customer Details

10 The third sheet: Customer Details


This sheet focuses on customers.

By now you have so much experience from creating dimensions, measures, and visualizations that you do
not need detailed procedures anymore. The only exception will be when you make changes in the properties
panel.

Customer Details sheet when editing

10.1 Adding filter panes


Do the following:

1. Add the filter pane Period, just like before.


2. Add a new filter pane with the dimension Manager.

Tutorial - Building an App - Qlik Sense, 1.1 46


10   The third sheet: Customer Details

10.2 Adding the scatter plot


The scatter plot uses the dimension Customer and the measures Sales and Quantity. You need to create
the measure Quantity and save it as a master item. Use the field Sales Qty and the aggregation Sum.
Because the field Sales Qty consists of two words, you need to enclose it with brackets: [Sales Qty] in the
expression.

In the properties panel, at the bottom of Appearance, use the Range setting for the Y-axis and X-axis to
exclude the negative part of the axes.

You probably noticed that two measures were added to the scatter plot. The scatter plot is used to visualize
the relationship between two or three measures. In this case the measures compared are Sales and
Quantity. Each bubble represents a Customer dimension value.

10.3 Adding the table Customer KPIs


The table Customer KPIs requires some help. You can reuse the dimension Customer and the measures
Sales, Quantity, and Margin that are available as master items. Add them in that order to get the same order
as in the screen shot.

The remaining measures need to be created.

For the measure # of invoices, use the following expression: Count (Distinct [Invoice Number])

For the measure Average Sales per Invoice, use the following expression:

Sum(Sales)/Count(Distinct [Invoice Number])

The qualifier Distinct is used in two of the expressions. By using Distinct, you ensure that an
invoice number is only counted once, even if it occurs several times in the data source.
Distinct sorts out unique numbers. Note that Distinct must be followed by a space before the
field name.

Adjusting the number formatting


Do the following:

1. In the properties panel, click Columns.


2. Click Sales and set Number formatting to Money.
3. Click the measure to close it.
4. Click Quantity and set Number formatting to Number (without decimals).
5. Close the measure.
6. Click Margin and set Number formatting to Number (12.3%).
7. Close the setting.

Tutorial - Building an App - Qlik Sense, 1.1 47


10   The third sheet: Customer Details

8. Click Average Sales per Invoice and set Number formatting to Money.
9. Close the setting.

Click @Done in the toolbar.

Congratulation on your achievement of building a Qlik Sense app! Before you start making data analysis, you
can complement the app with data storytelling.

Tutorial - Building an App - Qlik Sense, 1.1 48


11   Data storytelling

11 Data storytelling
With data storytelling you can create a presentation based on the data in your app. You can take snapshots
of selected visualizations and use them in your narrative together with text, shapes, and effects. You create
slides and design the story with your particular audience in mind. In your narrative you focus on key elements
and create a convincing story where you can get your message through.

An additional, useful feature of data storytelling is that you can easily, during a presentation, switch between
a snapshot in the presentation and its context in the app. In the app context, you can make new selections
and continue the analysis from where you left off in the presentation. After the analysis, you can resume the
presentation.

11.1 Taking snapshots


You will start the creation of your presentation by taking snapshots in the app. In the top right corner, use ê
to move to the sheet Dashboard.

In the presentation you will focus on the three largest regions and analyze the sales trends.

Do the following:

1. Right-click the visualization Sales per Region and select Take snapshot.
2. In Region, select Nordic.
3. Right-click the visualization Top 5 Customers and select Take snapshot.
4. Right-click the visualization Quarterly Sales Trend and select Take snapshot.
5. In Region, deselect Nordic and select USA.
6. Take snapshots from the same visualizations as for Nordic.
7. In Region, deselect USA and select Japan.
8. Take snapshots from the same visualizations as for Nordic.

You have taken all the snapshots you need and can continue to start creating your data storytelling slides.

11.2 Creating a simple story


You will create a short and simple story, where the focus is on creating a few slides with snapshots and titles.
A screen shot of the slide is presented before the step-by-step instructions.

Tutorial - Building an App - Qlik Sense, 1.1 49


11   Data storytelling

Slide 1

Do the following:

1. In the toolbar, click Ç and click Create new story.


2. Enter the title Three largest regions.
3. Click the story Three largest regions.
The data storytelling editor is opened.

4. Click / and drag a title to the slide.


5. Type the title Three largest regions.

6. Click Å to see the snapshots that you took previously.


The snapshots are shown with icons titles, and dates.
7. Drag the pie chart Sales per Region snapshot to the slide.
8. Resize the pie chart and place it according to the leftmost pie chart.

9. Click Ñ to open the Effect library.


10. Drag the option Any value to the pie chart.
The value Nordic is automatically highlighted.

11. Copy the pie chart and paste it next to the first one. You can either use Ctrl+C and Ctrl+V or ¶ and
∂ in the toolbar at the bottom.
12. In the new pie chart, click Ñ and select USA in the list Select data point.
13. In the same manner as for the second pie chart, create a third pie chart and highlight Japan.

The slide is complete. Click Save in the toolbar.

Tutorial - Building an App - Qlik Sense, 1.1 50


11   Data storytelling

Slide 2-4

The slides 2-4 show the top five customers and the quarterly sales trend for the three regions.The snapshots
are stored in the library in the order they were taken, with the latest one at the top. If you have followed the
procedures when taking these snapshots, the two at the top should be Japan, the two ones below, USA, and
the remaining two, Nordic. Do not worry about using the wrong snapshot, the next section will explain how to
verify which snapshot is which.

Do the following:

1. In the lower left-hand corner, click P and add a blank slide.


2. Click Å to see the snapshots.
3. Drag the bar chart for Nordic to the slide.
4. Drag the line chart for Nordic to the slide.

5. Click / and drag a title to the slide.


6. Type the title Nordic.
7. Resize and align title and snapshots according to the screenshots.

Now, follow the steps above to create sheets with the same content for USA and then for Japan. The size
and alignment of the title and snapshots should be the same as in the sheet Nordic.

You can right-click the sheet Nordic and select Duplicate to create a new sheet that can be
used as a template for the remaining sheets. Change the title and replace the snapshots.

Tutorial - Building an App - Qlik Sense, 1.1 51


11   Data storytelling

When analyzing these slides it is important to know that the figures for 2014 are half-year figures.
Extrapolating the figures for the full year would then give different forecasts for the different regions.

The story is complete. Click U in the upper left corner to play your presentation. You can navigate with the
left and right arrow keys, or by moving the mouse towards the left and right edges of the slides to use the
arrows.

Close the story and make edits, if needed. Below the slide you have tools for cutting, copying, and pasting
that can be useful when you edit your presentation. And, of course, you can use the panel to the right.

Switching between data storytelling and the app context


In data storytelling, you can switch any time from the presentation to the app context. Right-click the
snapshot and select Go to source to open the app sheet where the snapshot was taken. This gives you a
dynamic option to leave the presentation and make data analysis in response to questions from the
audience. When you have finished analyzing, you return to the presentation by clicking Ç in the toolbar.

The go to source option is also useful for the special purpose of verifying that the right bar charts and line
charts are used. When you select Go to source you will see which region that is selected for that specific
snapshot.

Additional options
There are many options that have not been used in this story. Experiment on your own. Try and add effects to
the bar chart. Add a new slide (Sheet) and embed a complete app sheet where you can make selections
when you are in play mode. Add URLs or bookmarks to text strings. There is plenty more to discover.

11.3 Thank you!


You have reached the end of this tutorial. We hope that you have learned a few things and realized that app
creation sometimes can be pretty easy and even somewhat fun. Qlik Sense is a powerful tool that is capable
of far more than what has been shown here. This is just the beginning!

Tutorial - Building an App - Qlik Sense, 1.1 52

Das könnte Ihnen auch gefallen