Wednesday, June 20, 2012

Optional detail filter in cognos report.

Create a valueprompt with 3 static Choices that give parameter ?PromptParameter? one of these values: allmissing, 1of2missing or nonemissing.

Choosing 1 of these 3 options results in a filter being used.

Only one detail filter is used. Remember, a detail filter can only be true or false.

Detail Filter:

( ?PromptParameter? = 'allmissing'
and [Data1] is missing
and [Data2] is missing)

or

( ?PromptParameter? = '1of2missing'
and
( [Data1] is not missing
or [Data2] is not missing))

or

( ?PromptParameter? = 'nonemissing')



There is another possibility not to use this filter but to add 3 dataitems that only count the data that is wanted. Then create 3 lists and make them conditional, but I like this "hack" better.
This way there is only one report with one list with one filter to maintain.

I like to do these things KISS ( Keep It Simple Stupid). KISS things are easy to maintain, easy to understand, easy to change, easy to explain and therefore highly efficient.

Please try to do these complicated things KISS. (As I learned from my Elmer.)

2 comments:

  1. hhmm ok.. I am going to make it conditional

    ReplyDelete
  2. Pretty article! I found some useful information in your blog, it was awesome to read on ibm cognos training , thanks for sharing this great content to my vision, keep sharing.

    ReplyDelete