Hi,
I've set up a report where the startdate and enddate prompts are on the report itself, as opposed to a prompt page and have added javascript to set the dates (today -15 and today -1).
I've also set up an optional filter to display data between ?startdate? and ?enddate?
It all works fine, however, I can't work out how to return data between those two dates when the report loads initially. If that can't be done, how to filter the initial report to show the last 14 days data.
Any help greatly appreciated.
The report is running before your prompts get set by your javascript. Set your filter such that if prompts are null (i.e. have not yet been set), it will use your desired start/end dates.
Thanks for your feedback bdbits. I altered my filter to be the following, however it made no difference.
cast([Reporting View].[Outbound Summary].[Date], date) >=
case when ?pStartDate? is null then _add_days(current_date, -15) else ?pStartDate? end and
cast([Reporting View].[Outbound Summary].[Date], date) <=
case when ?pEndDate? is null then current_date else ?pEndDate? end
I'll keep chugging away..... :)
Is this any use to you?
http://cognostips.weebly.com/blog/date-prompts (http://cognostips.weebly.com/blog/date-prompts)
You might be able to tweak the logic to get your fifteen days, and set a default value for the prompt for when the report runs.
Cheers BC - however, I'm trying to get the prompts working on the report (as opposed to a prompt page). Pulling my hair out with this one, but I'll get there (eventually). :)
What I was thinking was you could create an extra option in the prompt for 15 days and set that as the default option. I don't know if the report would run and pick that option up so that you get 15 days worth...I guess it might throw up those prompts. Anyway, thought it was worth sharing in case it was a possibility.
Yes, I see your train of thought there. I'll have a dabble and let you know.