COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: kmuller on 17 Jan 2007 12:03:00 PM

Title: dynamic default value of a date prompt
Post by: kmuller on 17 Jan 2007 12:03:00 PM
Does anyone know of a good way to set a default value such as sysdate, or current date for a value prompt?  The only think I can figure out how to do is set a static prompt.

Any help would be apprecaited.

-k
Title: Re: dynamic default value of a date prompt
Post by: tdyoda on 18 Jan 2007 12:02:54 AM
The only way I know that this can be done is via java script, but maybe someone has come up with a way to do this routine need in a different way.

Otherwise we all send in cards and letters asking for this functionality.
Title: Re: dynamic default value of a date prompt
Post by: MDXpressor on 18 Jan 2007 10:41:11 AM
Why a value prompt as opposed to a date prompt?  A date prompt will inherintly use the current date as a default value.
Title: Re: dynamic default value of a date prompt
Post by: kmuller on 19 Jan 2007 06:31:44 AM
I want to set a default value so that the user does not get prompted for a date.  This is for a dashboard project, so I want seemless transitions between dashboards.

-k
Title: Re: dynamic default value of a date prompt
Post by: MDXpressor on 19 Jan 2007 07:15:32 AM
So why use a prompt at all then?  Could you not just create a filter and use the 'current_date' or {sysdate}(if it is an oracle mart) function?
Title: Re: dynamic default value of a date prompt
Post by: kmuller on 19 Jan 2007 12:29:30 PM
We want to give them dynamic capability to change the parameters after the initial run.  Almost PowerPlay functionality....
Title: Re: dynamic default value of a date prompt
Post by: sir_jeroen on 19 Jan 2007 05:55:34 PM
What about a filter with the following expression:
#prompt('param1','token','year(<column>)=2007')#

where
param1 = parameter name,
'token' => required for pass-through
'year(<column>)=2006' => Default value
add this to your filter and create a dropdownlist that you assign to 'param1'
in which you specify the following:
static choice:
use: year(<column>)=2007 display: Current Year
use: year(<column>) =2006 display: Current Year
use: date = sysdate display: current date
...
etc.

what I mean: You create dynamic filters which are passed through to your report. People can make their time selection or whatever through the drop down... Easy and Fast..