BLOG

Nuances of using Filters and Variables in NPrinting

Nuances of using Filters and Variables in NPrinting

About NPrinting

NPrinting is a product of Qlik to generate the reports from QlikView and Qlik Sense Applications. Reports can be created in various formats such as PDF, Excel, Word, PowerPoint and HTML and the distribution can be scheduled and automated. In this blog we shall cover the critical differences that exist in usage of filters and variables in NPrinting.

NPrinting Filter Fundamentals:

NPrinting supports three types of filters:

i) Task Level Filter –

This is a Global level filter and applies throughout the task for all recipients.

e.g.: If we have to generate a report for 100 recipients for a given Year-Month, then the Year-Month filter shall be defined as a Task Level filter.

ii) Recipient Level Filter –

This applies for a specific recipient only.

e.g.: for each Recipient, the customer name needs to be selected in the QlikView application so that relevant data of the given customer only gets sent to the respective recipient. The Customer filter will be set as Recipient Level Filter. Please note all recipients details will be maintained in an Excel file.

iii) Object Level Filter –

In the attached Excel report if Sheet 1 and Sheet 2 require different filters then object level filters are used.

iv) Some Exceptions:

In the Email Body we may want to show a KPI based on yet another selection. When we apply filters at the object level in the report template, object level filters do not apply to Email Body.

Important Note: Object Level Filters do not apply to Email Body. This point will be discussed further.

NPrinting Report to be generated:

Below image is the Final Output that is taken as the target to be achieved from NPrinting –

If you check the above image, there are 6 specific configurations marked in the report. Each of them is explained below:

  1. Subject Line: Formatted as “<Report Name> for <Company Name> – <Month Name>”.
    • Variables are created in QV to get the Company Name and Month.
    • These QV variables are passed to the Email Body.
  2. Name of Attachment: Formatted as “<Company Name> – <Report Name> – <Month Name>”.
    • Company Name – Dynamically retrieved based on customer selection
      • Needs to be created as a variable in QV to get the Company Name.
      • QV variables are then passed to the Report Template.
      • Based on recipient level filter for each customer, Company Name contained in this variable will get changed dynamically
    • Report Name – Static Text
    • Month Name – Last Month
      • Needs to be created as a variable in QV to get the last month name
      • Pass this QV variable on Report Template.
  3. Salutation: Name of the Recipient
    • All the recipient details are maintained in Excel file along with the specific recipient filters.
    • Map the Excel field names with NPrinting
    • Then pass recipient full name variable on Salutation.
    • Based on recipient filter, salutation will be changed dynamically.
  4. KPI % : To be shown on Mail Body
    • Needs to be created as a variable in QV.
    • Pass this variable to Email Body.These KPIs may be present in the Excel file attached to the Email. However the KPI is computed in attached Excel using Object Level filters. As discussed earlier, object level filters do not apply to Email Body. Hence to solve this issue the below method may be used:In Qlik View create different variables for each of the KPIs to be shown in the email body. As object level filters do not apply to email body, populate these QlikView variables using the same filtering criteria that was used in the Object Level filter for generating the excel report.These three Qlik View variables can then be passed into NPrinting Email Body. The KPI values will show on the Email Body (Check Figure 3)
  5. Custom Status based on KPI % : Achieved/Not Achieved
    • % of Zone Utilization and Overall is greater than 75% , it should show status as “Achieved” else “Not Achieved”
    • Variable needs to be created in QV to meet this requirement.
    • Pass this variable on Email Body
  6. Email Signatures: Need to change Email Signature dynamically. The specific scenario is explained belowScenario: Say, 500 Customer reports need to be sent from the email of respective account manager of the customer along with his/her signature. Assume that totally ten account managers are there.It is not possible to dynamically change the Sender Email in a single task. The only way this can be achieved is to create ten different tasks, each task sending the reports from a different email ID. The email signature can actually be changed dynamically in a Task, but if you are having to create different tasks to manage different Sender Email IDs anyway, this feature will not be of much use.Configuring which customers out of the given 500 customers get mapped to which of the 7 tasks posed a new challenge. This was achieved by adding a Custom field in Recipient Excel file. Usage of recipient Excel file will be the subject of our next blog.

Explaining the usage of Variables:

All variables created in QlikView are available for use in the NPrinting Designer for Email body formatting. These variables may be either used as direct QlikView variables or as Recipient Variables. There is a slight difference in the scope of filters when we use the variables as QlikView variables or as Recipient Variables.

  • Recipient Variable –
    • In our example, on Email Body and Subject Line – Company Name, KPI %, Custom Status based on KPI needs to be shown for each recipient.
    • Hence QV variable needs to be chosen from Recipient Entity in NPrinting Email Body.
    • Only if a Recipient Variable is chosen, both the Task and recipient level filters will get applied.
    • Final output will contain last month’s data for the specific recipient.
  • QlikView Variable –
    • On Email Body, Month Name is the common word that needs to be shown for all the recipient.
    • So this QV variable can be chosen from QlikView Entity in NPrinting Email Body.
    • In this case only the task level filter will be applied i.e. Year/Month filter

An example of both of these cases is shown below in Figure 2 where Email Subject Line is being configured.

Figure 2:

  • Email Body configuration

In the following figure the same reference numbers are used in the email body as were used in Figure 1. Check out the configuration in Figure 3 with respect to the requirements in Figure 1.

 

Related Posts