0% found this document useful (0 votes)
9 views3 pages

Cognos Prompting - NIL Parameter Values and The Dropping of Optional Filters

This document explains NIL parameter values in Cognos and their impact on optional filters, highlighting that a NIL value indicates a user has chosen not to supply a value. When a NIL value is submitted, the corresponding optional filter is dropped from the query, regardless of other parameters. Additionally, it distinguishes between NIL and NULL values, noting that NULL is treated as a true null value in the database.

Uploaded by

leonardo.russo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Cognos Prompting - NIL Parameter Values and The Dropping of Optional Filters

This document explains NIL parameter values in Cognos and their impact on optional filters, highlighting that a NIL value indicates a user has chosen not to supply a value. When a NIL value is submitted, the corresponding optional filter is dropped from the query, regardless of other parameters. Additionally, it distinguishes between NIL and NULL values, noting that NULL is treated as a true null value in the database.

Uploaded by

leonardo.russo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Cognos Prompting - NIL parameter values and the dropping of optional

filters

Question & Answer

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

There are two scenarios where a parameter can be optional

1) The parameter is used within an optional filter. For example, consider the following expression inside an
optional filter.

In this case, the parameter “pCountry” is optional.

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.

The NIL parameter value

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.

Dropping of the optional filter

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.

**Added note on NIL vs NULL

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 …

WHERE Country is null


The only way that a user can actually supply a NULL value is when the prompt control is populated with values
based on a query and this query returned one or more NULL values.
Was this topic helpful?

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

You might also like