How To Perfect Your Qlik Sense Master Items Library

Qlik Sense Master Library - Featured Image

One of the best features in Qlik Sense is Master Items (or Master Library). We will cover some tips to make your Qlik Sense Master Items shine.

Qlik Sense Master Items – Why You Need Them

The Master Items list can contain dimension fields, expression definitions or even complete visualizations that are curated and standardized for the users. There are several benefits to creating a Master Library for each of your Qlik Sense apps.

Developer Icon1. Happy Developers – Makes expression maintenance easy for the developer. In the other product, QlikView, we create variables and dump definitions into them for reuse. With Qlik Sense, we now have a real mechanism purpose-built for reusability. Any changes made to a Master Item percolate through the entire application.

 

User Icon2. Happy Users – Creates an intuitive way for users to build their own analysis. When a developer creates this Master Library, the user need only drag-and-drop to create visualizations. This eliminates the need for users to understand Qlik Sense expression syntax.

 

 

Security Icon3. Happy Data Stewards – Because there is a centralized, single definition for each item and it is created by the developer, we can better create One Version of the Truth for our application.

 

 

Planning Your Qlik Sense Master Library

The first thing you will want to do is create three lists. Create one for all the dimensions your users will need to display. Then make a list of the common expressions users will require. Finally you should design an example set of visualizations for the user to utilize as a jumping off point for their own objects.

You should not be too concerned about covering every single field or every single metric that could ever be imagined. All the fields in the app are still available from the horizontal selections bar. And of course, users still have the ability to build an expression.

Tip:        If there are key fields or unassociated fields that should not be shown in any list, rename those fields with a special character like “%” or similar. Then create a line of code in your script:

set_hide_prefix

Just like in QlikView, this will effectively hide these fields from the user’s view (including your own view). Taken to the extreme, you could prepend all fields and then create your Master Dimensions and Master Expressions, thereby making only your approved Master Items available to users.

Creating Your Master Items

There are actually several ways to create items for your Master Items lists. We will go through each of them.

Method 1 – Data Model Viewer

Master Dimension or Expression can be added in the Data Model Viewer in preview mode. In the pics below we will add a Customer Master Dimension:

Adding a Master Item - preview_mode1

You must first get to the Data Model Viewer. In the upper right you will find the Preview Button

Adding Master Item - preview_mode2

If you highlight a field in the upper pane, you will see these buttons appear in the lower pane.

 

 

 

 

 

 

Adding a Master Dimension - preview_mode3

Clicking Add Dimension creates this field as a Master Dimension Item.

 

Method 2 – Field Lists

The second way to create a Master Item is to access the fields list in edit mode. This time, we created a drill-down dimension choosing hierarchal date fields.

Adding a Master Dimension - field_list1

Use the field list icon to see all the fields. Then click a field you wish to add as a Master Item. Again, you can select Dimension or Expression.

 

Adding a Master Dimension - field_list2

In this case, we will crete a drill-down dimension. Select the radio button and add the hierarchal fields to drill through.

Method 3 – Master Item List

The third way to create a Master Item is to add it directly in the Master Item pane. Here we will add a Master Expression. Master Expressions are probably the most useful since the user no longer will have to memorize expression syntax.

Adding a Master Measure - master_item1

Select the Link icon. Go to Measure and select new.

 

Adding a Master Measure - master_item2

Use the fx button to enter your expression. We are also assigning a tag of Sales to make it searchable.

 

Adding a master Expression - master_item3

When the expression is utilized in an object, you can search for that tag to find anywhere it is used.

Tip:        Assigning a tag to a Master Item makes it searchable by that tag. In this example, searching “Sales” displays the bar chart since it contains the master definition tagged with “Sales”.

Tip:        Note also that surrounding the expression with the num function will save the user from having to update the number format every time the expression is dragged into a new object.

Tip:        Unfortunately we cannot refer to existing Master Expression names to create new Master Expressions. But we can still create variables that house expression definitions. So theoretically, we could store base expressions in a variable and then use them to create our Master Expressions. This might be more trouble than its worth unless we have complex, repeated, set analysis

Method 4 – Design Grid

The last way to create a Master Item is from within the design grid. Here we add a Master Visualization to our Library:

Adding a Master Item - edit_object1

In edit mode, select an object and then right click to add the object to your Library as a Master Visualization.

Adding a master visualization - edit_object2

You can name the item and then click add.

 

Utilizing Master Items as a User

Now comes the fun part. Once the Master Items are created, creating visualizations becomes super simple.

Firstly, you should be aware that Qlik Sense Master Items cannot be added to, deleted from or adjusted in a published application. In fact, the field tab that usually appears on the left with your Master Library is removed from published streams.

To add a Qlik Sense Master Item to an object, click on the Dimension or Expression button inside the object. Note the Master Items float to the top when you click on Dimensions or Expressions. The other fields will appear underneath.

Using your Master Item - master_item_use1

Master Library items can also be dragged directly into an object.

master_item_use2

 

Final Thoughts

wish_list_graphic

Here is a wish list of future enhancements I hope get added to this feature:

  • Ability to categorize and/or sort the Master Items lists.
  • Would be great to reference existing Master Expression in a new Master Expression (like we can in QlikView). I find myself having to clumsily copy and paste blocks of code and then adjusting to create new measures.
  • The ability to drag Master Expressions to other fields that can hold an expression like color expressions, for example.
  • It would also be great to be able to create Master Items that are hidden. This way I could still govern all the expressions, but would not necessarily have to expose them to the user.

As we rapidly approach the promised-land of true Self-Service BI, we still have some way to go on the data prep side. But the addition of Qlik Sense Master Items brings the dashboarding part of the equation to fruition. Please be a good developer! The small effort of creating these Master Libraries will bridge that Last Mile for your users, giving them a true self-service experience.

If this post was helpful to you, please consider sharing it with your network. It means the world to me when you read an article, actually enjoy it or learn something and then click on one of the share buttons below to tell others. I appreciate your support and your participation in our community.

11 comments… add one
  • Reply Richard Pearce October 25, 2016, 8:28 am

    Morning Aaron,
    I’ve heard on the grapevine its possible to reference Master Items in other master items. I think its on a fairly recent version, although I haven’t tried myself I’ve heard on good authority its possible.
    Rich

  • Reply Jason Michaelides October 25, 2016, 9:15 am

    Hi Aaron,

    I’ll add two really big items to your wish list if I may!

    1. Build Master Items in the script (at least Dimensions and Measures anyway). Makes management much easier and allows external master control of cross-app items.

    2. An extension of above, really. Global Master Items ie sharing between apps with central management.

    A great start but a way to go I think…eg it takes a lot of clicks to edit them!

  • Reply Steve Dark October 25, 2016, 10:01 am

    Hi Aaron,

    Great post! A very comprehensive look at the subject.

    I probably don’t use Master Items as much as I should – although I always tell my clients to make full use of them!

    Where I find they are presently lacking is that you can’t (as far as I am aware) use them in all of the circumstances that variables can be used. A couple of common examples are where you have an expression on a chart and you then want to use that same expression for either the Sort expression (perhaps with Fabs around it) or the background colour expression. In these cases I end up using the Master Item for the chart expression and then using a variable for the other purposes (the Master Item is then just a reference to the same variable).

    Being able to reference a Master Item with a notation similar to $() would be awesome.

    Also, another minor ask would be the ability to change the legend on an expression built from a Master Item. Sometimes I need to use the same expression, but have a slightly different legend in different contexts (perhaps a column heading needs to be abbreviated from a legend on a chart axis).

    Thanks for the post.
    Steve

  • Reply Aaron Couron October 25, 2016, 12:24 pm

    Richard – I am on 3.1.1 and have tried to reference an existing master expression and am unable to do so. The way I would expect is by [name of master expression 1] – [name of master expression 2] for example. Maybe I am missing something?
    Jason – You are absolutely correct on all counts. The last point is especially annoying it just takes too many clicks to do ANYTHING in the tool today.
    Steve – Good points. Not being able to use master expressions in the chart settings is annoying for sure. You guys are all making me want to edit the post and its been live for less than 24 hours, lol.
    Thanks for the comments.

  • Reply Diego Bormann October 27, 2016, 6:45 am

    Agree with all off the above and also wish to add 1 more thing to the wish-list.
    When a master-item is build with an expression, when you make a selection on it. In the selections/filter-bar it is showing the expression instead of the label you have given it. Making it very hard to understand/read.. Why???

    I still love master-items though

    Diego

  • Reply Travis Touroo November 1, 2016, 10:33 am

    Hi Aaron – Great post and comments! I really love the Master Library concept and hope it continues to evolve. Another thing I would really like to see out of it is better integration and exposure to the user of the dimension/measure metadata we have taken the time to fill out. This is especially true for the user that is primarily going to consume base sheet content rather than enter edit mode and dig in to the app (sometimes I feel like this is all of my users 🙂 ). For example it would be awesome from a usability standpoint to be able to read the description of a master library dimension/measure from within a chart or KPI object (perhaps an additional option with a right click on an object). It is just clunky from a user standpoint to figure out which measure is being used in an object then navigate to the library to get the metadata on it. Hope you are doing well! – Travis

  • Reply Aaron Couron November 1, 2016, 1:13 pm

    Travis!
    I completely agree. I have also noticed it is sometimes vague what is being measured in a Qlik Sense object without hovering. Not to mention you can’t hover on a mobile device. Thanks for the comment. Good to hear from you.

  • Reply Dafi November 3, 2016, 3:46 pm

    Hi,

    Thanks for this tutorial, very clear!
    1. Is it possible to change the label of a master measure on a chart?
    I couldn’t find a way to do it, and this enforces giving different measures the same label
    in the master table.
    2. Is there a way to export all the expressions used in the master table?

    If not, would you consider the above useful to have in Sense?

    Thanks!

  • Reply Aaron Couron November 3, 2016, 4:30 pm

    Hi Dafi,
    The only way to change the label of a master item when used in an object is to “unlink” it from master item, at which point you can do what you want. I would hesitate to “give different measures the same name” in your master items because each expression does something different introducing confusion into a governed expression list.
    On your second question regarding importing/exporting, the API’s are open so you could do this if you have the ability to leverage them (I don’t). Or you can create variables in your script that house the expressions, so they could be managed tehere, but you would still need to create the expressions in the UI. This would be very powerful so I imagine a developer out there will eventuatlly create a utility extension for us to do this, but also would be a great feature for Qlik to add.
    Thank you so much for the comments and your interest!

  • Reply Aaron Couron November 3, 2016, 4:43 pm

    Actually after a little more research, there “is an app for that”. I was able to find an extension utility that can manipulate master list items: Governed Metrics Service: http://branch.qlik.com/#!/project/57655702febb2ca54e7149d2
    Please note I haven’t tried it.

  • Reply Dafi November 4, 2016, 6:01 am

    Hi Aaron,

    Your inputs are much appreciated! I will also check the extension you’ve mentioned.
    Re extensions – the other day, a developer told me he refuses to use the extensions for a customer, fearing that they are not stable and would not guarantee a continuous compatibility with Sense future versions…this is a serious argument and i wonder how other developers deal with this.
    BTW, Another feature I would like to see is an automatic documentation of an applications, which will include selected entities. This is partly possible in QlikView.
    Dafi

Leave a Comment

Join us at Living QlikView

Never miss a post.

We Never Spam. NEVER.

Show Buttons
Hide Buttons