Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Type-In Prompt Report in Cognos Impromptu

Cognos Impromptu

Multiple Type-In Prompt Report in Cognos Impromptu

by  GJParker  Posted    (Edited  )
The following is copied from an article originally submitted to Cognos SupportLink by By Trevor Comeau, Support Specialist, Cognos Customer Support

The original article can be seen here
http://support.cognos.com/supported/supportlink/14n1/p60.html

I have copied the article here for those users who do not have access to the Cognos support site.

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.



Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top