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

Default Selection

Started by cognostechie, 31 Jan 2011 07:16:45 PM

Previous topic - Next topic

cognostechie

Trivial question for most of you  ;)

I have a Value Prompt for selecting the Year. I want the default selection to be the current year. Is there a way to tell RS to determine the current year ? Wrap an HTML item around the Prompt? or sort it descending and set the focus to the first item? any other way?

Thanks !

PRIT AMRIT

there r quite a few work around though...

Pls have a look at the below link and see if it helps?

http://www.cognoise.com/community/index.php/topic,9773.msg32101.html#msg32101


Thanks
P

melee

Quote from: cognostechie on 31 Jan 2011 07:16:45 PM
Trivial question for most of you  ;)

I have a Value Prompt for selecting the Year. I want the default selection to be the current year. Is there a way to tell RS to determine the current year ? Wrap an HTML item around the Prompt? or sort it descending and set the focus to the first item? any other way?

Thanks !

PRIT makes a good suggestion. Here's mine though, in case you're looking for a direct answer.

http://nicbertino.com/?p=48

cognostechie

Thanks PRIT and melee. I used PRIT's  suggestion and this one also works:

getFormWarpRequest()._oLstChoicesyear.selectedIndex = 1;

Sort the prompt descending so 2011 comes up on the top so it selects that.

I still have a problem. The prompts are on the report page so first time the report opens, the filter has to use the current year to filter the data. I don't want to use promptbuttonfinish() because it won't let the user choose the year again.

melee

What version are you on?

cognostechie

8.4   I am using a cube package. What expression would I use to filter the report for current year when it is run 1st time and then filter it based on what is selected from the Prompt.
The extract(year,current_date) won't work with cube package.

cognostechie

I got it to work one way (either way) but not with a combination.

Created a data item with the expression - lastchild([ReportPeriod]) where [ReportPeriod] is the member from the tree. The name of this data item is 'Period' and the value will be the latest year.

Filter =

(?DatePrompt? < '' and [Date Dimension].[Year] = [Period])

OR

(?DatePrompt? > '' and [Date Dimension].[Year] = ?DatePrompt?)

Doesn't give any syntax error but still shows value that belong to an earlier Year