Reader small image

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

Product typeBook
Published inAug 2018
PublisherPackt
ISBN-139781788997058
Edition2nd Edition
Right arrow
Authors (3):
Pablo Labbe
Pablo Labbe
author image
Pablo Labbe

Pablo is a Business Intelligence Consultant with over 18 years of experience. In 2008 he was presented to Qlikview, the former product by Qlik and the seed for Qlik Sense. Since that year he was focused on delivering BI solutions in a new way. Now he is the Principal of ANALITIKA Inteligencia delivering BI projects and training focusing on Qlik products and other technologies that embrace the Self-Service BI. He is an active member of the Qlik Community and other social media sites. You can follow him on Twitter - @pablolabbe and LinkedIn.
Read more about Pablo Labbe

Philip Hand
Philip Hand
author image
Philip Hand

Philip Hand is a Senior Business Intelligence consultant who has worked with QlikView in the BI space for over 7 years. Working with Qlik's top partner in the UK, he has implemented end-to-end solutions in a wide variety of enterprises and for large business customers. Philip has great experience and knowledge working across many sectors from the public sector, insurance, and financial services to large retailer and manufacturing businesses.
Read more about Philip Hand

Neeraj Kharpate
Neeraj Kharpate
author image
Neeraj Kharpate

Neeraj Kharpate works as a Senior Business Intelligence consultant at Capventis, a QlikView Elite Partner. Having started his career working as a technical support executive for an aviation ERP, Neeraj embarked on his journey with Qlikview in mid-2007. He is a certified Qlikview designer, developer, and trainer. Neeraj has been closely following the developments in Qlik Sense ever since it was launched in 2014 and is extremely excited about the future of this product. Neeraj has completed his Masters in Business Administration from the Norwich Business School, University of East Anglia. He also has a diploma in Management Consulting from the Chartered Management Institute, UK.
Read more about Neeraj Kharpate

View More author details
Right arrow

Creating a master library from the Data model viewer


To help reduce the repetition and developer error, Qlik has introduced a master library where we can store reusable items, such as dimensions, measures, and even whole visualizations. For people experienced with Qlik's other products, such as QlikView, just think, "No more linked objects and storing expressions in variables!"

It is easy to think of library items in a self-service context. Don't get me wrong; ultimately, you will have to decide what will be published – from your data model to the world for their own analysis purposes. Having said that, the secret sauce of this recipe is in saving your own time.

It is a productivity hack that implies, "Automation is to your time what compound interest is to money." While it is not an exact parallel, this is a nice concept to frame the usefulness of time-saving functions in Qlik Sense. The effective use of the library saves time spent on scrolling downfield lists, rewriting expressions over and over, and applying a single change in multiple places.

Once you have saved enough time to eclipse the setup investment, the value of taking this approach can only compound with continuous development.

Getting ready

  1. Create a new Qlik Sense application and name it Master Library.
  2. Open the Data load editor.
  1. Enter the following script and load the data by clicking on the button (the script is available in a separate text file that can be downloaded from the Packt Publishing website):
Data: 
LOAD * INLINE [ 
    Name, Region, Country, City, OrderId, Sales, Company, 
     OrderDate 
    Wooten, C, Mozambique, Carmen, 1, 45.55, Est Nunc 
     Laoreet LLC, 22/12/14 
    Blankenship, Delta, Cayman Islands, Sapele, 2, 95.76, 
     Lorem Donec Inc., 17/01/15 
    Sheppard, Wyoming, Vatican City State, Cheyenne, 3, 
     38.31, Lobortis, 07/08/14 
    Goddard, H, Curaçao, San Francisco, 4, 86.33, Non Inc., 
     07/09/14 
    Galloway, Aragón, Trinidad & Tobago, Zaragoza, 5, 
     85.80, Diam Proin., 21/01/15 
    Kirsten, Tamil Nadu, Wallis & Futuna, Neyveli, 6, 
     28.47, Mollis Non Limited, 03/05/14 
    Holland, Cartago, Falkland Islands, San Diego, 7, 1.34, 
     Ullamcorper Inc., 17/07/14 
    Thaddeus, BC, Canada, Oliver, 8, 59.04, Ante Nunc 
     Mauris Ltd, 17/02/15 
    Lareina, CA, Spain, San Diego, 9, 4.55, Pellentesque 
     Tincidunt Limited, 29/07/14 
    Jescie, Vienna, Monaco, Vienna, 10, 54.20, Ultricies 
     Ligula Consulting, 16/06/14 
    Logan, IL, Saint Barthélemy, Paris, 11, 91.31, Mi 
     Foundation, 13/12/14 
    Shannon, CG, Nepal, Aberystwyth, 12, 80.86, Auctor Non 
     LLC, 03/05/14 
    Andrew, SO, Argentina, Sokoto, 13, 88.78, Scelerisque 
     Mollis Associates, 12/12/14 
    Jocelyn, WP, Tanzania, Konin, 14, 15.91, Ligula Tortor 
     Dictum Ltd, 22/08/14 
    Gordon, FL, Hong Kong, Miami, 15, 93.97, Suscipit Inc., 
     12/05/14 
];

How to do it…

Once the data has been loaded, you can check the results by opening the Data model viewer through the Navigation dropdown () in the top corner on the left-hand side of the toolbar, as shown in the following screenshot:

You can find the Preview button at the bottom-left of the screen. There are several other places in Qlik Sense where you can create master library items, but the data model preview screen is the best, as it also lets you see the data first. Take a minute to browse the data you have loaded in the Data model viewer:

  1. In the Data model viewer, select the Data table by clicking on its header and then click the Preview button to view the fields and the field values loaded from the Data table.
  1. The Preview window will appear, as shown in the following screenshot:
  1. Select the Region field from the table to get the preview, as shown in the following screenshot:

  1. Click the Add as dimension button.
  2. The following window appears. If you are likely to publish this dimension for consumption by users, you can enter a description here:
  1. It is advised to use tags to make our life easier. Add the Geo tag and click on 
  2. Click on the Add dimension button to create a master dimension in the library.
  3. Repeat this process for the Country and City fields.
  1. Click on Done to go back to the Data model viewer.
  2. It's time to create a measure. Select the Sales field from the Data table in the Data model viewer.
  3. Click the Add as measure button. When we create a Master measure, we need to make sure we use an aggregation function, such as Sum or Avg, along with the selected field.
  4. In the Create new measure window, type SUM in front of (Sales), as shown in the following screenshot:
  1. Click on Create.
  2. Save the changes made in the master library by clicking on the button on the toolbar in the table preview. Exit the table preview by going to App overview.
  3. Open (or create) a sheet and enter the edit mode by clicking on the Edit sheet button.
  4. Once you are in edit mode, click the chain (
    ) icon on the left-hand side of the asset panel to open the Master items menu.
  5. To add visualizations, first create them in the user interface and then drag them into the library.

While the Master items menu panel is very useful to speed up the development when defining the content, it is easier to do it from the filters pane. In short, you can browse the entire content of your data model and right-click on the most important fields to add the ones that will be frequently used.

How it works…

  1. Right-click on a field from the field's pane that you want to add to the master library:

 

  1. Click on Create Dimension, enter a Description and any relevant Tags, and click Done once finished:

There's more...

We can also create Master dimensions and measures through the GUI. In order to do this:

  1. Open an existing sheet or create a new one.
  2. Click on the Master items (
    ) icon.
  3. Click on either Dimensions or Measures. This will enable an option to create new library items.
Previous PageNext Page
You have been reading a chapter from
Qlik Sense Cookbook. - Second Edition
Published in: Aug 2018Publisher: PacktISBN-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.
undefined
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

Authors (3)

author image
Pablo Labbe

Pablo is a Business Intelligence Consultant with over 18 years of experience. In 2008 he was presented to Qlikview, the former product by Qlik and the seed for Qlik Sense. Since that year he was focused on delivering BI solutions in a new way. Now he is the Principal of ANALITIKA Inteligencia delivering BI projects and training focusing on Qlik products and other technologies that embrace the Self-Service BI. He is an active member of the Qlik Community and other social media sites. You can follow him on Twitter - @pablolabbe and LinkedIn.
Read more about Pablo Labbe

author image
Philip Hand

Philip Hand is a Senior Business Intelligence consultant who has worked with QlikView in the BI space for over 7 years. Working with Qlik's top partner in the UK, he has implemented end-to-end solutions in a wide variety of enterprises and for large business customers. Philip has great experience and knowledge working across many sectors from the public sector, insurance, and financial services to large retailer and manufacturing businesses.
Read more about Philip Hand

author image
Neeraj Kharpate

Neeraj Kharpate works as a Senior Business Intelligence consultant at Capventis, a QlikView Elite Partner. Having started his career working as a technical support executive for an aviation ERP, Neeraj embarked on his journey with Qlikview in mid-2007. He is a certified Qlikview designer, developer, and trainer. Neeraj has been closely following the developments in Qlik Sense ever since it was launched in 2014 and is extremely excited about the future of this product. Neeraj has completed his Masters in Business Administration from the Norwich Business School, University of East Anglia. He also has a diploma in Management Consulting from the Chartered Management Institute, UK.
Read more about Neeraj Kharpate