Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. READ MORE

Dynamic Links in Qlik NPrinting Reports to Sense Apps

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Ruggero_Piccoli
Support
Support

Dynamic Links in Qlik NPrinting Reports to Sense Apps

Last Update:

Apr 8, 2022 4:37:06 AM

Updated By:

Sonja_Bauernfeind

Created date:

Mar 28, 2019 5:28:40 AM

The goal is to insert dynamic links to the Qlik Sense app used to populate a Qlik Nprinting report with the same filters that produced the report.

 

Environment:

Qlik NPrinting 
Qlik Sense Enterprise on Windows 

 

The Qlik Sense help site page Embed objects, apps, and visualizations informs that it is possible to create a link to a Qlik Sense app with applied filters in the URL. For example: https://<servername>/sense/app/4d541aea-a8b1-4cef-a4c2-6bda620321a9/sheet/XuWLHFK/state/analysis/options/clearselections/select/Year/2014/select/Region Name/International;Canada where:

  • 4d541aea-a8b1-4cef-a4c2-6bda620321a9 is the linked app ID placed after the /app/ keyword
  • XuWLHFK is the sheet ID placed after the /sheet/ keyword
  • /options/clearselections/ is the option to clear all previous selections
  • /select/ is the keyword that must precede each filter
  • /Year/ is the name of the first field we want to filter
  • /2014/ is the value to keep. To keep more values you have to separate them with a semicolon like /International;Canada

So to create a link to the Qlik Sense app in the generated report we need to concatenate a fixed first part, that links the app ID and the sheet ID, with a second, dynamic, part that sends to Qlik Sense the Qlik NPrinting filters.

To create the second part we can use the GetCurrentSelections() function GetCurrentSelections - chart function that also allows to customize the separators. To obtain results consistent with the Qlik Sense URL format we will use GetCurrentSelections('/select/','/',';').

We will create an URL so pay attention at the unsafe characters. If they are present in field values they can invalidate the created link. Refer to https://www.ietf.org/rfc/rfc1738.txt or to https://help.dragonmetrics.com/seo-help-center/site-issues/invalid-characters-in-url or to other web pages about this topic.

Also adding the max_values parameters is a good idea to avoid that the ‘x of y valuess’ expression invalidate the generated URL.

Open a Qlik NPrinting report template. To keep the explanation simple we will create an HTML report with only the link.

Add a new formula on the Formulas node, insert a name, select the correct connection and insert a formula like: ='https://SenseServerAddress/sense/app/AppID/sheet/SheetID/state/analysis/ options/clearselections/select/' & GetCurrentSelections('/select/','/',';'). Of course you must customize the first part.

010.png

Then create an HTML link in the template by using the formula. Something like: <a href="%%LinkToSenseBeginnerAppWithFilters%%">Link to Qlik Sense App</a>.

Save the template and run a report preview without filters. Click the link in the preview to check that the Qlik Sense app is opened correctly without filters.

020.png

Clicking the link will open the Qlik Sense app.

030.png

Create a Qlik NPrinting filter as usual and apply it to the report. Run a new preview.

In the screenshot below you can see that the created link now contains the filtering information.

040.png

Clicking on the link will open the Qlik Sense app with the correct filters applied.

050.png

Tags (3)
Contributors
Version history
Last update:
‎2022-04-08 04:37 AM
Updated by: