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

Multi-Or-And Filter Help

Started by tconnery, 03 Nov 2005 07:49:13 AM

Previous topic - Next topic

tconnery

First time forum user.....  I have a programming question for how to setup a multi prompt filter.  Currently my filter lets you enter a start date, end date, variable w, x, y, z.   I can enter the date range and ONE varialbe only to run the query.  What I need is the correct filter to also let me search by any combination of w,x,y,z.

Any ideas...  filter is attached as a gif


dwood09

using an "IN()" statement in the filter statement will automatically change the prompt to a multi select.

cheers,
DW

danimahesh


By default, Cognos Impromptu does not support the ability to input multiple entries into a type-in. The following is a method that will allow a user to type in multiple entries into a prompt, delimited by commas. This example allows the user to enter up to three prompt values separated by commas. Five calculations are required to turn the original prompt into three separate values that can be passed to the filter. The steps are shown below.
Ã, 
Step 1
Calculation 1: Find the position of the first comma in the prompt. (You can create the prompt in this calculation.)

Calculation Name = C1
CODE
position(',',?P1?)


Step 2
Calculation 2: Substring the first value from the prompt based on the first comma's position.

Calculation Name = P1
CODE
substring (?P1?,0,C1 )

Step 3
Calculation 3: Find the second comma by substringing the first prompt value (and comma) from the prompt.

Calculation Name = C2
CODE
position(',',substring( ?P1?,1 + C1,100))+C1

Step 4
Calculation 4: Substring the second prompt value from the report.

Calculation Name = P2
CODE
substring(?P1?,C1 + 1,C2 - C1 - 1)

Step 5
Calculation 5: Substring the third value from the prompt.

Calculation Name = P3
CODE
substring(?P1?,1 + C2,100)

Step 6
In the filter, define the following definition to use all three values that were extracted from the original type-in prompt.
CODE
BranchCode in ( P1,P2,P3 )

Step 7
The prompt entry will be:
CODE
MAN,STOC,MEL

The ability to handle more type-in values can be added into the report but it will require each one to be extracted via its own calculation.