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

How to Provide Current Date for a Scheduled Report in Cognos

Started by Prerna Chaudhary, 27 Aug 2014 02:17:01 AM

Previous topic - Next topic

Prerna Chaudhary

Hi ,

I have a Cognos report where I have a date prompt from which the user can select the date to run the report.

Now  I need to schedule it to run daily for every hour.

So the problem that we are facing here is how to set the date prompt dynamically in the scheduled report.

Now whne I schedule the reprot, the reprot is running everyday, but the date selected is the first day when I had scheduled the report.

So when I see the report output on next day, it still shows data for the previous day.

For ex: If I have given the date prompt value as 25 th august and run it for further days say 26th, 27th, 28th august or further. Then the report runs showing  data for 25th August  only which was the first date value supplied.

Any help on this will be appreciated.

Thanks and regards
Prerna Chaudhary

Francis aka khayman

using your example, you give 25th august, then the report run on august 25 and the data is for august 25...

if its august 26 and the report run, what should be the correct data?

shrini

As you are passing Aug25th, it takes as the input parameter for every run. You need to change logic in your report.

riteshsinghrathod

Hi

Whats the issue your facing in hard coding current date in the fields which uses prompt value ?

I guess you would have already thought about it.

Prerna Chaudhary

Thanks to you guys for your prompt replies.



@Khayman- For 26th August the reprot should show data for 26th August

@ritesh- The date values  are not hardcoded. The prompt page has  a date prompt and some text prompts.

So when I am scheduling the report, then I am overridding the default prompt values with the required values for the text prompts.

But in thsi process, the date prompt is also getting set for the current date.

So if I am scheduling the report on 25th August then this is set as the report date

And this date is being used evrytime for further dates also  like 26th, 27th ,28th and so on.

Is there any way to fix this.

Thanks and regards
Prerna Chaudhary

riteshsinghrathod

Hi Prerna,

Since you want the report to use current date. is it feasible for you to take the copy of the existing report -> disable/delete the date prompt -->and  hard code the AsOfDate() to all the places where ever dateprompt value was used

I know its cumbersome, but just a workaround until u get a dignified solution.

Lynn

Prompt responses are determined and set at the time you schedule. I assume your package is relational although I don't think you specified. If it is relational read on. If dimensional then post back as the answer will be different. Specific syntax for your source may vary slightly but this should give you the general idea.

You have a couple of options.

Option 1) Add a prompt to select run mode, such as ?RunMode? with static choices such as "Prompted" or "Scheduled". Modify your filter to something like this:


(
?RunMode? = 'Prompted'
and
[YourDate] = ?DatePrompt?
)
or
(
?RunMode? = 'Scheduled'
and
[YourDate] = current_date
)


Option 2) Schedule the report with a totally ridiculous date a user would never select such as Jan 01 1900 and then modify your filter to something like this:


(
?DatePrompt? <> DATE '1900-01-01'
and
[YourDate] = ?DatePrompt?
)
or
(
?DatePrompt? = DATE '1900-01-01'
and
[YourDate] = current_date
)