COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: barrysaab on 10 Mar 2014 10:58:39 PM

Title: How to Restrict time period
Post by: barrysaab on 10 Mar 2014 10:58:39 PM
I have two date prompts  From Date to To Date  ,I want to retrieve information for
2012 jan to 2012 oct only but By default it is displaying all years information,I don't want to display other years information.How can  I restrict it to specific time period.Thanks for your help.

Title: Re: How to Restrict time period
Post by: Hukumaram on 11 Mar 2014 05:03:08 AM
This can be probably done by javascript.

http://www-01.ibm.com/support/docview.wss?uid=swg21396610

Thank You
Title: Re: How to Restrict time period
Post by: navissar on 11 Mar 2014 05:13:37 AM
Hi Barry,
It wasn't very clear what you need to do.
1. If you want to set the default value of the prompts (Like, in a prompt page) you'll need a script for that. Let me know if you're using 10.2+ or an earlier version and I'll hook you up with a script.
2. If you want that when the report runs initially (There's no prompt page) it will run for a certain date, the technique is different whether you're on dimensional or relational.
3. If you want to limit the date prompts' range, use the method offered by Hukumaram...
Title: Re: How to Restrict time period
Post by: BigChris on 11 Mar 2014 05:45:33 AM
I read that as wanting to limit the dates that are available in the prompt, so that the user can only select to run the report between Jan 2012 and Oct 2012. If that's the case, there are properties that you can set for the From prompt and the To prompt. If you click on the prompt and look in the properties panel on the left hand side you should see a First Date property and a last Date property.
Title: Re: How to Restrict time period
Post by: mitwa on 11 Mar 2014 07:36:44 AM
give filter as

[Date] between ?from-date?   and  ?To-date?
Title: Re: How to Restrict time period
Post by: barrysaab on 16 Mar 2014 09:21:02 AM
Hi Gurus, Thanks for the help, Sorry  I wasn't able to provide detail info. The filter
[Date] between ?from-date?   and  ?To-date? did the trick. Thanks a lot again.