Cognos Prompting - NIL Parameter Values and The Dropping of Optional Filters
Cognos Prompting - NIL Parameter Values and The Dropping of Optional Filters
filters
Question
This document explains in detail what exactly a NIL parameter value is and what its impact on an optional filter
is.
Answer
Optional Parameters
1) The parameter is used within an optional filter. For example, consider the following expression inside an
optional filter.
2) The parameter is defined as a macro prompt with a default value. For example, consider the following
expression inside a required filter.
The above prompt macro provides a default value (i.e. Canada) therefore the parameter “pCountry” is optional
even though the filter is required.
When a parameter is optional and the user is prompted to enter a value for this parameter, the user will have the
ability to NOT supply a value and then click Next or OK on the prompt page. (When a parameter is required, the
user will not be able to click Next/OK until a value is supplied).
When the user does not choose a value and clicks OK, a value is indeed submitted to the query engine for this
parameter. That value is NIL.
Therefore the NIL value means that the user has explicitly chosen not to supply a value.
The most significant impact that a NIL value can have is that the optional filter containing this parameter will be
dropped entirely from the query. Note that the optional filter will be dropped as soon as one of its parameters
has a NIL value. Therefore, it doesn’t matter if the other parameters in the filter have non-NIL values.
If the parameter is not found inside an optional filter (i.e. it is used in the context of a macro prompt with a default
value), then the default value defined in the prompt macro will be used.
Note that there is a difference between a NIL parameter value and a NULL parameter value.
A NULL value is treated as a true null value against the underlying database.
For example, with the above filter expression, if ‘pCountry’ is supplied a NULL value, the resulting SQL will have
the following WHERE clause
SELECT …
FROM …
Yes No
Document Information
More support for:
Cognos Business Intelligence
Software version:
10.2.2, 10.2.1, 10.2
Operating system(s):
Windows
Document number:
270569
Modified date:
15 June 2018