COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: cognoshelp911 on 21 Jul 2010 12:20:07 PM

Title: Create a custom drop down list
Post by: cognoshelp911 on 21 Jul 2010 12:20:07 PM
Hi,

I need to create a custom drop down list with values I specify and then depending on what the user chooses, the data will pull up.  How do I create a custom list that will populate in my value selection prompt for the user to select? 

For example, my drop down list with include Division 1, Division 2, Division 3 and then depending on what the user chooses, sales data will pull up for that Division.  The determination of what constitutes a Division will be determined in my query where if organization number starts with 561 then it will fall in Division 1, etc.  I know I can just have the drop down show 561 but I don't want the user to have to remember that 561 belongs to Division 1.

I hope this makes sense, thanks for any help!
Title: Re: Create a custom drop down list
Post by: rockytopmark on 21 Jul 2010 02:36:24 PM
Just add your selections to the Prompt's "Static Choices" List.

Use Value is behind the scenes, and Display value is what user will see.

Use = 561        Display = Division 1
Use = 562        Display = Division 2
etc...
Title: Re: Create a custom drop down list
Post by: cognoshelp911 on 21 Jul 2010 06:50:41 PM
Thanks for your reply but quick question:

Division 1 actually includes 561A, 561B, 561C and not just 561.  Is there a way I can specify starting with 561 or do I need to do this:

use:  561A display: Division1

use:  561B display: Division1

use:  561C display: Division1

Thanks for your help!
Title: Re: Create a custom drop down list
Post by: rockytopmark on 22 Jul 2010 02:21:05 PM
Just write your query filter to use the parameter along with the Substring function, such as:

substring([query_subject].[division],1,3) = ?pDivisionParm? 

So using 561A, we'd have substring ('561A',1,3) = '561'

...which will give you a hit.