In NPrinting you can create:
- Static filters based on field values
- Dynamic filters based on expressions in QlikView syntax
- Filters based on QlikView Advanced Search
Filters based on fields can use both existing field values and also values which do not currently exist in the data (this may be useful for slowly changing fields).
Dynamic filters use QlikView syntax expressions which are calculated at run time and then applied to the filter field. You can only use expressions whose output is a single value (e.g. "year(now())").
To create a search expression that involves search criteria for associated fields and full boolean logic you can use QlikView Advanced Search that is supported by NPrinting and explained in the tutorial "How to Use QlikView Advanced Search with NPrinting Filters".
The use of QlikView Bookmarks is still supported (see: Creating NPrinting Filters Based on Existing QlikView Bookmarks) but we suggest the use of the Advanced Search feature when you need to create complex dynamic filters.
NPrinting allows users to associate filters with Tasks, Recipients and Reports. It is also possible to apply one specific filter to a table or an image inside a report (refer to How to Apply a Specific Filter to Tables or Images).
Filters are applied in a specific order: Task filters are applied first, then Recipient filters, and finally Report filters. This may have an impact on which values are in the final data set created for any given report. NPrinting filters are applied in the same way and with the same logic as filters applied by a QlikView user using the QlikView desktop application.
Create New Filter
- Click on Filters in the lower left pane
- Click on Filter in the New group in the ribbon
This opens the Filters window
- Give the filter a Name
- Optionally enter a Description
- Click on the Add button in the Fields group to add one or more fields to your filter
Select Field(s) You Want to Use in Your Filter
- Select the Connection to the QlikView document that contains the fields you want. The Select Field window lists all available QlikView documents and the fields they contain
- Scroll down to and select the Year field
- Click on the OK button to add the field
Select Existing Field Values to Add to Filter
- Click on the Add Values button in the Field window, which opens the Select Values window listing all the values for that field present in the QlikView document
- You can select one or more values (use Shift or Ctrl + Click)
- Click on the OK button at the bottom of the Select Values window
Add New Value
You can add values to the filter manually for values not present in the QlikView file.
- Click on the green '+' button to add a new row below the existing values in your filter
- Click on the cell in the new row in the Value column and enter any year value. Any data related to that value will be included in the report if and when that data becomes available in the QlikView document
- Click on the corresponding box in the IsNumeric column so that it is checked
- Enter the numeric value corresponding to the string of numeric characters that has been entered in the Value column
You can delete rows with values you do not want
- Select the row(s) you want to delete
- Click on the red '-' button
- Click on OK in the Confirm dialog to delete the selected rows
- Conclude by clicking on OK in the Field dialog window
Add an Expression in QlikView Syntax
You can create filters based on expressions in QlikView syntax. The limitation is that any expression to be passed by NPrinting to QlikView for evaluation must return a unique value compatible with the selected field. For instance, "year(now())" returns a unique integer value compatible with the field Year. "Year>2010" returns a unique value, however, it is boolean (true or false) which is therefore not compatible with the Year field which is an integer. Also ">year(now())" and "2014>year(now())" are incorrect.
NPrinting also supports QlikView Advanced Search. Refer to "How to Use QlikView Advanced Search with NPrinting Filters".
- Click the green "+" to create a new row
- Click on the cell in the Value column and type in the QlikView syntax expression you want to use
- Select the IsNumeric check box so that the expression is used for comparison as a number and not as a string
- Select the Evaluate check box so that NPrinting forwards the expression to QlikView for evaluation
QlikView advanced search is supported by NPrinting filters. Refer to "How to Use QlikView Advanced Search with NPrinting Filters"
Set Filter Parameters
There are five filter parameters in NPrinting field filters. You can set one or many of these parameters when you create your filter. Parameters are applied in the order that filters are applied (first Task filters, then Recipient filters and finally Report filters).
1. Locked: this will lock this field; if there are other filters based on this field in NPrinting, they will not be applied.
2. Verify filter: this will do two things:
a) If a filter with Verify filter is applied and the resulting data set is empty, then NPrinting will not generate a report. This can be used to do conditional reporting.
b) If a filter without Verify filter is applied, NPrinting try to select values that not exist in the .qvw. In this case QlikView enables all values so NPrinting will generate a report with the unfiltered dataset. For instance, if you filter for France and 2013 but there were no sales in France in 2013, NPrinting will create a report with sales on all other countries.
3. Select Excluded: If you select this check box, you will filter for all of the values of the field that you DID NOT select (e.g. you filter Male for Gender and use the Select Excluded parameter, then the report will be filtered for Female)
4. Drop Field (in reduce): If you select this check box, when you run a reduce Task, the resulting QlikView QVW will not contain that field
5. Unlocked if Locked: this will unlock fields that are locked in Qlikview
Save Field, Values and Parameter Settings
Click on OK to save the field, values and parameters settings