COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: thedon_1 on 14 Feb 2012 11:06:05 AM

Title: Need to add a custom row to a prompt - Use macros?
Post by: thedon_1 on 14 Feb 2012 11:06:05 AM
I have a prompt which lets the user select different UK cities e.g London, Manchester, Birmingham etc.

I want a line under the citites that says UK, this will then give me a seperate line in the output list for UK with the consolidated values of all the cities.

Is this possible? Can I define what is included in UK?

Title: Re: Need to add a custom row to a prompt - Use macros?
Post by: blom0344 on 14 Feb 2012 12:36:54 PM
You can add a static choice to the prompt which will be shown in the dropdown list.  By setting the use value to a proper high integer (say 999999) and sorting the data for the prompt query it will appear at the end.

Your data query should then either select values related to a city or fetch all data:

example:

[citykey]  =  [?city_key?]  or [?city_key?] = 999999
Title: Re: Need to add a custom row to a prompt - Use macros?
Post by: thedon_1 on 15 Feb 2012 06:06:01 AM
Thanks for the reply, I understand what you mean and it worked.

One other thing. Righjt now, If I have a static selection of UK, it gives me all the cities that make up the UK. I want one line that gives me the aggregated values of the UK.

So for example, If I select UK and Birmingham in my multi-select prompt, I get one line for Birmingham and one line for UK.

Is this possible?
Title: Re: Need to add a custom row to a prompt - Use macros?
Post by: blom0344 on 15 Feb 2012 07:10:38 AM
Sure, use a union.  Set 1 covers the selection for individual cities and set2 fetches all data in case the static prompt value is among the chosen values.  In set 2 replace the city description by the fixed value 'UK'