COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: kgcognos on 24 Oct 2013 01:39:04 PM

Title: How to set up drop down values
Post by: kgcognos on 24 Oct 2013 01:39:04 PM
I need a value prompt for my year parameter.
The drop down should show only 2 years based on the current month.
If current month < Oct, it should show current year and previous year.
If current month >= Oct, it should show current year and next year. 

We are new to COGNOS, we don't have a time dimension setup yet so I cannot reference a member.

How and where can I setup my required years and setup the prompt to display these years?

Thank you in advance.
Title: Re: How to set up drop down values
Post by: calson33 on 24 Oct 2013 05:06:32 PM
You could do it using an SQL query for the prompt. I don't know how that would interact with dimensional data though.

Title: Re: How to set up drop down values
Post by: MFGF on 25 Oct 2013 04:09:06 AM
Are you using a relational package (query subjects and query items) or a dimensional package (dimensions, hierarchies, levels and members / attributes)?

MF.
Title: Re: How to set up drop down values
Post by: snagaboina on 25 Oct 2013 04:44:46 AM
Hi,
i tried with below code in the filter section of prompt query for relational model and it is working.
See if this help for u

[YEAR] in (YEAR(current_date),YEAR(current_date)+1) and MONTH(current_date) >9
or
[YEAR] in (YEAR(current_date),YEAR(current_date)-1) and MONTH(current_date) <=9

Thanks!