Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Qlik Sense Cookbook. - Second Edition

You're reading from  Qlik Sense Cookbook. - Second Edition

Product type Book
Published in Aug 2018
Publisher Packt
ISBN-13 9781788997058
Pages 334 pages
Edition 2nd Edition
Languages
Authors (3):
Pablo Labbe Pablo Labbe
Profile icon Pablo Labbe
Philip Hand Philip Hand
Profile icon Philip Hand
Neeraj Kharpate Neeraj Kharpate
Profile icon Neeraj Kharpate
View More author details

Table of Contents (16) Chapters

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Getting Started with the Data Visualizations Scripting Managing Apps and the User Interface Useful Functions Set Analysis Using Extensions in Qlik Sense Advanced Aggregation with AGGR Tips and Tricks Other Books You May Enjoy Index

Chapter 9. Tips and Tricks

In this chapter, we will focus on some useful tips and tricks, such as the following:

  • Working with multiple tabs
  • Using the keyboard to navigate and interact
  • Working with the distinct clauses
  • Managing variables in the script and layout
  • Using measure names in object expressions
  • Creating dynamic charts

Introduction


This chapter will focus on useful tips and tricks to keep your work more productive.

Working with multiple tabs


During the process of creating a new application, we quite often must work with the Data load editor to prepare the data loading process and, after reloading, go to the layout editor and check some numbers with the visualization objects, and then go back to the Data load editor to add another data source or fix an error in the data load process. It is a cyclical process.

This recipe will show you how to work with the Data load editor and the layout editor on multiple sheets at the same time using the web browser.

 

Getting ready

For this recipe, we will use the app created in Chapter 8, Advanced Aggregation with AGGR. You can also use your existing app if you have access to the data source used to load it.

How to do it…

  1. Open the web browser of your preference.
  2. Type in the following URL: http://localhost:4848/hub. It will show the Qlik Sense Desktop hub.
  3. Open the app created in Chapter 8Advanced Aggregation with AGGR.
  4. Click on the Navigation button to open the menu.
  5. Click...

Using the keyboard to navigate and interact


Qlik Sense was primarily conceived to be used by touch gesture or a mouse device. The keyboard is used to type commands, expressions, text, and activate some shortcuts.

This recipe will show you how to use some useful shortcuts.

Getting ready

For this recipe, we will use the Automotive.qvf file, which comes as a built-in example when we install Qlik Sense Desktop.

How to do it…

  1. Open the Sales overview sheet.
  2. Type CTRL + E to enter Edit sheet mode.
  3. Click on the Line chart object to select it.
  4. Type CTRL + C and CTRL + V to duplicate it.
  5. Type CTRL + Z to undo the operation.
  6. Change the size of the objects, and note that the Save button becomes active.
  7. Type CTRL + S to save the app with these changes.
  8. Type CTRL + E to enter sheet view.
  9. Type CTRL + - to zoom out of the window.
  10. Type CTRL + + to zoom in the window.
  11. Type CTRL + O to reset zoom in the window.
  12. Click on Brazil in the Car Sales by Territory donut chart.
  13. Type Enter to confirm the selection.
  14. Click on the Territory...

Working with the distinct clause


When building a Qlik Sense app, you often have to deal with some data issues such as duplicated records or values in a field. The duplication can be created by design, just like the customer ID in a sales transaction table, or could be an error if we find two exactly identical records created in a table.

This recipe will show you how to use the distinct clause to work with duplicated data in the Data load editor as well as in the object expressions.

Getting ready

For this recipe, we will make use of an inline data load that gives us sample data to demonstrate how the distinct clause works:

  1. Create a new Qlik Sense file, and name it Distinct Clause.
  2. Add the following Inline table that contains the location information for countries:
SalesData: 
LOAD * INLINE [ 
    Product Line, Product Group, Product Sub Group, Year, Sales, Cost 
    Drink, Beverages, Juice, 2015, 12000, 6000 
    Drink, Beverages, Juice, 2015, 12000, 6000 
    Drink, Beverages, Juice, 2014, 16000...

Managing variables in the script and layout


Qlik Sense provides the option to define variables in the script and in the user interface.

The variable editor interface enlists the existing variables created in the script, and provides the user with the option to create new variables as well.

Getting ready

For the purpose of this recipe, we will make use of an inline data load that gives the sales information for four countries:

  1. Create a new Qlik Sense application, and call it QS_Variables.
  2. Load the following script in the application:
Sales: 
LOAD * INLINE [ 
Country, Sales,COS 
USA, 1000,500 
UK, 2000,1000 
France, 3000,2500 
Germany, 4000,4700 
]; 
 
Let vTemporary = 'Sum(Sales)'; 
Let vRedColor=RGB (255, 0, 0); 
Let fSales= vTemporary; 
Let vTemporary = null(); 

How to do it…

  1. Open the QS_Variables application.
  2. Create a new sheet called Sales, and go to the Edit sheet mode for the sheet.
  3. While in Edit sheet mode, notice that we have a new icon,
    , in the lower-left corner. Click on the icon to open...

Using measure names in object expressions


Qlik Sense provides the Master items to create dimensions and measures to be reused in the Visualization objects.

Each measure has a fixed label and, in some cases, we can use the measure name instead of the base expression to create new measures or for coloring a chart by expression.

Getting ready

For the purpose of this recipe, we will make use of the QS_Variables app created in the previous recipe. Ensure that you have already loaded the variables from the variables spreadsheet.

How to do it…

  1. Open the QS_Variables application.
  2. Open the Sales sheet and enter the Edit sheet mode for the sheet.
  3. On the Master items section, go to Measures.
  4. Add a new measure with the $(fMargin %) expression, and type in Margin % as a label.
  5. Add the Margin % measure to the existing table.
  6. Go to the Data section and expand the properties of the newly added measure.
  7. Type in the following expression in Background color expression:
if([Margin %]<0,vRedColor) 
  1. Add a new measure with...

Creating dynamic charts


To increase the flexibility of a single chart object, you can set it up so that the dimension used is based on what the user wants to see. This is a much more efficient use of space for single sheets, and makes the whole experience much more dynamic.

Getting ready

For the purpose of this recipe, we will make use of the sales information for different fruits, as defined in the script:

  1. Create a new Qlik Sense application and call it QS_DynamicCharts.
  2. Load the following data into the Data load editor:
Transactions: 
Load  
 Mod(IterNo(),26)+1 AS Period, 
 Pick(Ceil(3*Rand()),'Standard','Premium','Discount') AS 
   ProductType, 
 Pick(Ceil(6*Rand()),'Apple','Orange','Cherry','Plum','Fig', 
   'Pear') AS Category, 
 Pick(Ceil(3*Rand()),'Heavy','Medium','Light') AS Weight, 
 Pick(Ceil(2*Rand()),'2013','2014') AS Year,  
 Round(1000*Rand()*Rand()*Rand()) AS Sales 
Autogenerate 20 
While Rand()<=0.5 or IterNo()=1; 
 
SET vDimension = 'GetFieldSelections(Dimensions)'; 
 
Dimensions...
lock icon The rest of the chapter is locked
You have been reading a chapter from
Qlik Sense Cookbook. - Second Edition
Published in: Aug 2018 Publisher: Packt ISBN-13: 9781788997058
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}