NPrinting Filters – Part 4 (Variables)

This is second last filters feature gap which just got patched in NPrinting November 2019. This version introduces variable filters which in short allows you to set variable value when executing task or whenever filter is used.

Now how and when you may want to use it?

Variable as chart dimensions: It is very common in QlikView and Qlik Sense application to use variable as dimension. This allows for dimension toggle depending on user choice. If the same Qlik object needs to be used in NPrinting, with variable filter we can now choose which dimension will be used when report gets produced.

Let’s have a look at the sample below. First obvioulsy we need a source of data for NPrinting report. In this sample I am using Qlik Sense. I create 2 variables, first holding a dimension name (field in data model) and second to hold dimension name label.

Creating variables in Qlik Sense

I built sample Qlik Sense table with one dimension and one measure. As a dimension I use variable vDimension_1 and as its label I use vDimension_1_Label variable. Below is a result where you can see that by default label is “First Dimension” and values are coming from “Dim1” field (A,B,C)

Qlik Sense object and variable as dimension

With my source object ready I now move to NPrinting and create report template. I use previously built Qlik Sense table and drag and drop it on the template. Additionally I bring Qlik Sense variable as a NPrinting template variable (variable entity) and use it as a column header to allow for dynamic header label.

NPrinting template with Qlik Sense object (note additional variable used as table column header label)

With the template ready I now move back to NPrinitng console where I create a variable filter. For variable vDimension_1 I assign value Dim2. This will result in using Dim2 column as field/dimension in Qlik Sense table. I also set vDimension_1_Label variable value to “Second Dimension”. I then use this filter as a report filter in NPrinitng.

NPrinting filter replacing default Qlik Sense variable values

When I run NPrinting report variable filter is used and it adjusts dimension in chart. See results below.

Process overview

The above sample shows how you assign static value to variable. Regardless of where this variable is used its value can be changed using NPrinting variable filter.

You can change variable value used in set analysis, variable used to calculate time frames (YTD, MTD, WTD etc…), change variable to show different container object, change variable controlling colors or simply use it as a label/text.

What other use cases are feasible? You can comment below and I will be more than happy to take an example and write about it.

cheers

Lech

2 Comments

  1. Hi Lech

    Great article!
    I was also excited about this feature. However I am missing something very important and maybe you have noticed it as well. When importing variable filters with Excel they are imported wrongly as fields.
    Actually there is a syntax when we imported them in NP 16 like in this thread in the Qlik community: https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Nprinting-Filters-vs-Current-Selections/td-p/967686

    However I’m wondering if you are facing the same issue.

    Kind regards
    Hatus

    Like

    1. Hi Hatus,
      I think there is a bug in current sample files for recipient import. I did test it and I bluntly assumed there should be additional column (judging by how Advanced search was added in previous versions…) so I added it manually..
      In Filters sheet you need to have additional column called “Variables” where you would put your variable name and value/expression
      hope this helps!

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s