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

Preselection of a date prompt

Started by nugget, 19 Jan 2009 01:55:16 AM

Previous topic - Next topic

nugget

hi forum,

how is it possible to set a preselection on a date prompt. i have a dimension which includes serveral years e.g. 2006, 2007, 2008 an so on.

i want that the year e.g. 2008 is preselectet if the report runs.

i think its a little javascript code necessary.

the id of the prompt is "JAHR". can anybody help me with the code?

nugget

angela

I wouldn't use javascript as it's unsupported upon upgrade.

If it's just a year I'd go to the Year query that supplies it and and in the filter put something like:

Case [Year]
When 'Current Year'
Then extract(year,[DateField])
Else [DateField]
End

Then add a static choice of Current Year to your prompt.

nugget

Thx for your reply,

i found another solution for my problem! i insert the member-uniquename of the object e.g. 2009 in the defaultvalue of the prompt.


Rajaggopal

But if the user runs the report next year say 2010 and the default year selected is 2009, will it server his purpose, because you are hard coding 2009 to be the default value.

nugget

yes thats right but i found no better solution at the moment. any ideas?

Rajaggopal

How about the idea angela suggested? it suits ur needs?

nugget

i dont understand angelas solution.

can somebody tell me (step by step) what i have to do?


Manic

Hi friends,

In simple oracle we can extract like below,
to_char(sysdate,'YYYY') from table_name.

But Cognos, have anyone tried the function of the "Closing period".it might be solve ur problem.

maximumiq

Was this solved, and if so, how ?

I have the same problem, and would hate to use javascript.


nugget

no i dont understand the posted solution by angela  >:(


CognosPaul

Depending on the version of Cognos, and how you've structured the query, I can offer you a few possible solutions.

It looks like this is a dimensional query, are you using filters or slicers?

The easiest solution would be to simply place a prompt macro with a default selection into the slicer.

For example
#prompt('Year','memberuniquename','[CurrentYearMember]')#

If the user runs the report without selecting a year, it will simply default to [CurrentYearMember].