COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: krishdw85 on 10 Sep 2024 12:23:26 PM

Title: prompt end date should be my schedule run date always dynamically
Post by: krishdw85 on 10 Sep 2024 12:23:26 PM
Hi Team,

i have a start date & end date in my report and whereas start date is static and end date should be always current date as per scheduled which is tuesday in my report.
I somehow unable to recall how to set  default slections in cognos 10.2  Can someone advice how to set end date as current date for default prompt in scheudle.

Regards,
Krish
Title: Re: prompt end date should be my schedule run date always dynamically
Post by: dougp on 10 Sep 2024 02:11:19 PM
It's scheduled.  Don't use a prompt.  Use current_date
Title: Re: prompt end date should be my schedule run date always dynamically
Post by: cognostechie on 10 Sep 2024 07:34:19 PM
Quote from: krishdw85 on 10 Sep 2024 12:23:26 PMHi Team,

i have a start date & end date in my report and whereas start date is static and end date should be always current date as per scheduled which is tuesday in my report.
I somehow unable to recall how to set  default slections in cognos 10.2  Can someone advice how to set end date as current date for default prompt in scheudle.

Regards,
Krish


There is a property of the Date prompt where you can put a default selection. Put 1901/01/01 there. In the query, put a filter like:

( ?EndDate? = 1901-01-01 and [Date] = current_date)
                     OR
( ?EndDate? <> 1901-01-01 and [Date] = ?EndDate? )

 
Title: Re: prompt end date should be my schedule run date always dynamically
Post by: dougp on 11 Sep 2024 10:56:56 AM
Except that the date must be required.  If the date filter is optional, the date prompt is optional and using the "edit box" UI, and no value is entered, the result is all rows.

This should work:
[Date]= #prompt('End Date', 'date', 'current_date')#
Title: Re: prompt end date should be my schedule run date always dynamically
Post by: cognostechie on 11 Sep 2024 12:24:44 PM
No. If there is a default date specified and no date is entered then the default value will be considered and in that case the filter will work and the result will be data only till the current day.
Title: Re: prompt end date should be my schedule run date always dynamically
Post by: dougp on 12 Sep 2024 01:40:30 PM
Got it.  I missed a step.  You don't leave it blank, you leave it at the default.  So you'd schedule it with an end date of 1901-01-01.
Title: Re: prompt end date should be my schedule run date always dynamically
Post by: krishdw85 on 18 Sep 2024 08:14:30 AM
Sorry... somehow it is not working.... Can someone please guide me exact which logic to be used.