If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Filter with option to include or exclude data

Started by maxchuie, 25 Apr 2017 08:22:13 AM

Previous topic - Next topic

maxchuie

RS 10.2.2 FP8
I need to create a radio button option for Include or exclude and the ability to filter a search and select prompt with it.  Has anyone tried this or can you point me in the right direction.

I did try this http://www.cognosonsteroids.com/2012/03/show-or-hide-date-prompts-based-on.html
but it did not work.


New_Guy

Hi,
Can you explain it with a sample?

Good luck
New guy

BigChris

#2
I haven't tried it, but I would imagine you could write a filter that looks something like:

(?pFilterIncExc? = 'Include' and [YourDataField] contains ?pSearchString?)
or
(?pFilterIncExc? = 'Exclude' and [YourDataField] not contains ?pSearchString?)

CognosPaul

The radio prompt should have:


Use     |     Display
--------+-------------
in      |   Include
not in  |   Exclude


Then your filter would be something like:
[Field] #prompt('includeOrExclude','token')# (#promptmany('searchParam','integer')#)

You could also use a checkbox by doing the following:


Use     |     Display
--------+-------------
not in  |   Exclude


[Field] #prompt('includeOrExclude','token','in')# (#promptmany('searchParam','integer')#)

When the box is checked for exclude, the filter will be "[Field] not in (123,124)" when it is not checked, it will use the default from the macro and be "[Field] in (123,124)"