Qlik Community

Qlik NPrinting Documents

Documents related to Qlik NPrinting.

Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today

How to Control Report Generation with Conditions

Not applicable

How to Control Report Generation with Conditions

Control report generation by applying conditions to reports.  Add multiple conditions to any report. Reports are generated ONLY when their conditions are satisfied.

There are three types of conditions that can be created using this feature:

  1. Check if an existing QlikView variable is greater, less or equal to a fixed value or a QlikView syntax expression at run time. In the latter case, you must also select the Calculate check box.
  2. Compare the values of two QliView variables. Available comparisons are: equal to, not equal to, greater then, greater then or equal to, less then, less then or equal to.
  3. Check that a certain QlikView chart HAS VALUES or IS EMPTY at run time. The result is that reports are generated for some recipients and not for others. This type of condition is illustrated in this tutorial.

A Task will be created that generates Sales Reports only for those salesmen whose total sales for a given period exceeds a specified value.


Create Condition


We are going to set a condition which will generate reports only if a specific QlikView chart has values at run time. The chart we are selecting has two fields; the salesman dimension and the sales expression which is calculated as follows: if(sum(Sales)>250000, sum(Sales),0).

This chart only displays values for those salesmen whose sales are greater than 250000. Only those recipients who have filters for salesmen whose sales were >250000 will receive reports because we are sending reports to recipients who have filters on the salesman field, only those recipients who have filters for salesmen whose sales were >250000 will receive reports. When filters for the other recipients are applied, the chart we use will be empty because those salesmen whose sales were >250000 will be filtered out and therefore will not receive reports.

  1. Select Conditions in the lower left pane
  2. Click on the Condition button to start the creation of a new condition

Enter Basic Parameters

  1. Enter a descriptive Name for your Condition
  2. Enter a Description (optional)
  3. Select the browse button at the extreme right of the Chart field since the determining condition is going to be whether CH264 has values to display or not

Select Chart(s) to Import

  1. Highlight the chart by clicking on it
  2. Click on the OK button

Set Chart Condition


Set your condition in the Rules section. Choose for a Variable to be equal to or not equal to a certain value and/or whether a Chart from your QlikView document has values or is empty.

  1. Select for the condition to be satisfied when CH264 has values for this tutorial
  2. Click on Save and Close

Set the Condition for a Report


Select the "Excel Conditional Reporting" report and double click on it. The report window will open. Whatever report you choose must contain CH264 in its template and the chart must have values for at least one salesman or no report will be generated.


Add Condition to Report

  1. Select the Conditions icon in the Show group
  2. Click on the Add icon in the Conditions group
  3. Select the condition you want to apply
  4. Click on the OK button

Conclude Applying Condition


Click on the Save and Close icon to save the report settings


Create Report Task

  1. Select Tasks in the lower left pane
  2. Select Report Tasks in the upper left pane
  3. Click on Report Task in the New group on the ribbon at the top of the window. The Task window will appear.

Add Basic Parameters

  1. Enter a Name for your Task
  2. Enter a Description (optional).

Add Conditional Report to Task

  1. Select the Reports icon in the Show group
  2. Click on the Add icon in the Reports group
  3. Highlight the Conditional Reporting report
  4. Click on the OK button

Revise Report Settings


Reports can be generated in formats different from the template format and/or compressed. See: How to Create Tasks


Add Recipients to Task

  1. Select the Recipients icon in the Show group
  2. Click on the Add icon in the Recipients group
  3. Highlight the Recipients the report should go to. Two recipients have been highlighted here, one recipient is a salesman whose total sales amounted to more than 250,000 and the other, not
  4. Click on the OK button

Conclude Task Creation


Click on the Save and Close icon


Preview Output Folder


It is empty!


Run Task

  1. Select the Conditional Sales Report Task
  2. Click on the Run icon

Review Log Messages

  1. The Sum of Sales greater than condition was satisfied for Helen Brolin in the Conditional Reporting report
  2. The Sum of Sales greater than condition was not satisfied for Elvis Presley in the Conditional Reporting report

Check the HelenBrolin Sub-Folder


A report was generated


Check the ElvisPresley Sub-Folder


No report was generated.

Version history
Revision #:
1 of 1
Last update:
‎2015-04-24 04:30 AM
Updated by: