COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: kgcognos on 31 Oct 2013 07:12:55 PM

Title: How to set default value on value prompt
Post by: kgcognos on 31 Oct 2013 07:12:55 PM
I have a year parameter with drop down values. Values are 2012,2013,2014. I am using a page prompt.
When I run the report, I want to display the page prompt and set the year to automatically select 2013. Please help on how I can accomplish this?

Thank you in advance.

Title: Re: How to set default value on value prompt
Post by: gagnonp on 01 Nov 2013 08:22:21 AM
There are tons of example on this forum to accomplish this. A simple google search will also give you what you need.

If you cannot find it, have a look at this wiki:

http://cognoswiki.wikispaces.com/Modifying+Prompts+with+Javascript
Title: Re: How to set default value on value prompt
Post by: kgcognos on 01 Nov 2013 12:49:33 PM
I need to default the year based on current month (ie if month < 10, then default to current year, else default to next year). I cannot hard code the year. I would like to try to set the default WITHOUT using Java script. Is this possible? If so please assist step by step on how to accomplish. Thank you.   
Title: Re: How to set default value on value prompt
Post by: gagnonp on 01 Nov 2013 01:04:32 PM
Your only option is javascript with Cogos 10.1 and  prior.

Also I heard that version 10.2 has new prompt functionally.
Title: Re: How to set default value on value prompt
Post by: kgcognos on 01 Nov 2013 01:33:00 PM
See #5 option in article below. I cannot make it work. I'm very new to COGNOS. Is it possible to use this option to default my year parameter? 
How to set default value.
http://cognosknowhow.blogspot.com/2013/04/how-to-dynamically-set-up-default-value.html