If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Defaulting to the first day of the week

Started by tomj55, 14 Apr 2010 09:50:18 AM

Previous topic - Next topic

tomj55

Is there a method to set up a date selection prompt that will default to the beginning of the week (Sunday or Monday) rather than a mid-week day?

eliza_jane

This is possible with Javascript. You can search for javascripts to set a default date in date prompt.

MMcBride

This a relational or multidimensional source? i.e. are you useing a Cognos Cube?

If you use a Cube you may want to consider a Prompt Macro vs Javascript.

I used to use JavaScript to set my defaults for all my date prompts but when I upgraded to 8.4 last year I had a lot of problems and ended up removing the Javascript and replacing them with Prompt macros with the help of Cognos support.

I have a currentmonth Data object that is defined as
#prompt('finishMonth','memberUniqueName','closingPeriod([packaname].[Accounting Date].[Accounting Date].[Month], item(tail([Packagename].[Accounting Date].[Accounting Date].[Year], 1), 0))')#

This example sets the Default value to Current Month but it gives you the general idea.

I haven't used a Promptmacro with a relational source so I am not sure how well it work for you if thats what you use.

tomj55

Thanks to both of you.  I greatly appreciate the suggestions and example.  I'll see if I can get the code to work for me and let you know.