COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: M on 13 Sep 2013 03:37:01 AM

Title: Report scheduling - Date issues
Post by: M on 13 Sep 2013 03:37:01 AM
Hi guys,

I am trying to schedule a report which has date prompt.

Current date is selected as default date while running in schedule. How can i make the report to pick the previous date while running in schedule and report should also support custome date while running manually?

Thanks in advance



Title: Re: Report scheduling - Date issues
Post by: linhlv on 13 Sep 2013 05:18:35 AM
Hi,

You can add a Filter to make sure that the Previous Day was selected. You can get the previous date by using Javascript.

http://www.ibm.com/developerworks/library/ba-pp-reporting-scripting_techniques-page634/
Title: Re: Report scheduling - Date issues
Post by: adik on 13 Sep 2013 05:49:43 AM
i don't think javascript will work for setting a default date prompt as javascript is executed when you run the report so that the html is displayed. prompting does not run the html, but it runs the queries in the background
what i would do is i would create the date parameter using the prompt macro and you could have something like #prompt('date_parameter', 'date', 'current_date - 1')#
this will set a default date for the parameter as current date - 1, so if you don't select anything if will default to this value
you can schedule the report and remember to uncheck the check box that says prompt for values
Title: Re: Report scheduling - Date issues
Post by: M on 13 Sep 2013 06:38:06 AM

Thanks a lot  Adik and Linhlv.

I try the below.

A flag is populated with the load date in the Database when the ETL load is done.

I brought that flag and date in the model and schedule it in event studio to run the report  when the flag is Y and i pass the date(previous date) and its working.

I will try the macro and java script.