Emulating document chaining in Qlik Sense

In QlikView document chaining is drilling down from one application to another automatically transferring selections.

The current version of Qlik Sense (2.0.1 beta) does not support document chaining yet,but with some efforts, we can achieve a very close approximation of that functionality.

To make a sample I’ve created a couple of applications with identical models (with load scripts copied from QlikView Script editor’s Test script). First application, AppChainingMain, would play the role of a master dashboard (nothing fancy, just one sheet with a Pie Chart and couple of list boxes to filter data)

AppChainingMain

Second application, AppChainingDetail, is similarly basic in design and consist of one table with transactions details

AppChainingDetail

Our goal will be to add the drill-down feature from AppChainingMain into the AppChainingDetail with current selecitons transferred.

The first problem to solve is to find a method to open Qlik Sense application with some predefined selections. Qlik Sense Single Integration API is ideally suited for that purpose. For example, such URL could be used to open sheet with id rMmqj of application AppChainingDetail with selected value Bin field Dim1 and selected values Y and Z in field Dim3

http://localhost:4848/single?appid=AppChainingDetail&sheet=rMmqj&opt=currsel&select=clearAll&select=Dim1,B&select=Dim3,Y,Z

The first part of that URL string is somewhat static or better to say application and environment specific. That part of URI I separate into a variable vG.ChainUriPrefix with definition

http://localhost:4848/single?appid=AppChainingDetail&sheet=rMmqj&opt=currsel&select=clearAll

Assuming you are testing attached sample applications with Qlik Sense Desktop, that part would be just that. Would you prefer to test it with Qlik Sense server that variable should be changed (localhost changed to hostname/ipaddress of your server and Application name changed to AppId of imported application in your server). You can safely create such URLs in the Single configurator at Dev hub.

Truly dynamic parts of URIare are these

&select=Dim1,B
&select=Dim3,Y,Z

These URI query fragments code field selections to make in AppChainingDetail and should be made automatically on base of current selections in AppChainingMain.

To create these fragments more easily I add variable vG.SelectionQuery in variable editor with definition:

If(GetSelectedCount($1)=0,Null(),'&select=' & '$1,' & Concat(distinct $1,','))

With these two variables in place, we can create Text & Image object and use these variables in expression to check a resulting URL Expression in question would have such definition:

vG.ChainUrlPrefix & $(vG.SelectionQuery(Dim1)) & $(vG.SelectionQuery(Dim2)) & $(vG.SelectionQuery(Dim3))

In that case, we pass selections in fields Dim1, Dim2 and Dim3

Making various selections we could see how that URL is changing. Unfortunately, I do not know the easy way to copy text from Text & Image object. (The not so easy way is to find it by localhost:4848 substring in Code Inspector). So now we can copy that text, paste it into the browsers address string and see if all works as intended. In my case, it does and AppChainingDetail opens with same selections as in AppChainingMain.

Next step is to actually add some control with that drill-down feature to AppChaingingMain application. Text & Image object has a link property, but it cannot be linked to an expression, so, for now, it is not suited for that purpose.

So basically, we should find some extension wich is capable of opening dynamically formed URL. I’ve tried Sheet Navigation + Actions for Qlik Sense and it works well for me. So we create extension button with label “Open details”, navigation action “Open website” and formula in Website URL same as in Text & image object before, but prepended by equal sign. Clik on newly added button and sheet from second application will be opened:

Drill down

Take a notice that though detail sheet has a filter panel, application panel is unavailable. So for example navigation to other sheets in detail app should be implemented by some other means - by same “Sheet Navigation + Actions” or some other extension (maybe drop-down menu extension could be utilized to implement navigation between sheets of both applications)

Sample applications (AppChainingMain, AppChainingDetail) are available for download, Sheet Navigation + Actions extension should be already installed for drill-down to work

comments powered by Disqus