If i read this correct the ?pSnapshotdate? is in the FM package filter, then it will always be mandatory.
Original Message:
Sent: Tue January 30, 2024 07:23 PM
From: Varshini Niharika
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hello Rene/All,
The Data requirement is for all Departure Dates restricting for 2 years but for the particular snapshot date i.e. being Yesterday's date.
So originally using IBM article,
https://www.ibm.com/support/pages/how-pass-current-date-scheduled-report-prompt
we tried to use the Parameter 1 so, we can bypass the parameters in scheduled reports, but it did not work. So, need a solution where I can make the pSnapshot date = Yesterday date and get all the Departure dates> 2years
I.e.
on a day: 02-01-2024 the data value was 10 Qty for specific elements for departure date 2-02-2024
on a day: 02-01-2024 the data value was 11 Qty for specific elements for departure date 3-02-2024, and it will remain same until next product is sold.
so, on other day:
15-01-2024 the data value changed to 15 Qty for specific elements for departure date 2-02-2024
15-01-2024 the data value changed to 14 Qty for specific elements for departure date 3-02-2024
So, we need, the report to run automatically, for the snapshot date on 30-01-2024 as of today(31-1-2024) and give all the details of the elements for all departure dates on that particular day.
But now, even having Parameter set to 1, if the snapshot date = 2-1-2024, it is not overriding and still using the snapshot =2-1-2024 rather than 30-1-2024
and providing wrong data.
Thanks,
Varshini
------------------------------
Varshini Niharika
Original Message:
Sent: Tue January 30, 2024 04:27 AM
From: René Kent Nielsen
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hi,
The filter would be
[Departure Date]>= [DepDateFilter] or [Departure Date]< [DepDateFilter]
But it will return every [Departure Date], so why would you use a filter ?
#IBMChampion
------------------------------
René Kent Nielsen
Brand manager
CogniTech A/S
Herning
Original Message:
Sent: Mon January 29, 2024 08:48 PM
From: Varshini Niharika
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hello Rene,
Thank you for your reply, the above will only work, if we need the Data filtered on only Departure Date >= Yesterday's date. But the requirement here is to get all the data of Departure date old(<) and new(>=), on a pSnapshot date which should be Yesterday's date.
But because pSnapshot is a Date prompt coming from the FM package as default, we cannot make the parameter pSnapshot = Yesterday date bypassing the prompt value given in Scheduled report. How to do that.
Hope you are getting what I am trying to achieve here.

Kind Regards,
Varshini
------------------------------
Varshini Niharika
Original Message:
Sent: Mon January 29, 2024 02:29 AM
From: René Kent Nielsen
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hi,
Put you if statement in a query object insted, lets call it DepDateFilter :
if (? Parameter1? =1) then (_add_days(current_date;-1) ) else (?p_SnapshotDate?)
And then the filter would be :
[Departure Date]>= [DepDateFilter]
I don´t get the 2 or in you filter, it will return all dates if you have a >= follow by a < on the same date.
#IBMChampion
------------------------------
René Kent Nielsen
Brand manager
CogniTech A/S
Herning
Original Message:
Sent: Mon January 29, 2024 01:03 AM
From: Varshini Niharika
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hello All/IBM Champions,
So, what is happening with the prompt solution applied, it works fine when we run it manually and by choosing Parameter1 =1 and the pSnapshot_date=Yesterday_date.

The Report Query filter = if (? Parameter1? =1) then ([Departure Date]>= [Yesterday date] or [Departure Date] < [Yesterday date]) else ([Departure Date]>=?p_SnapshotDate? or [Departure Date] <?p_SnapshotDate?)
The Issue now is:
when we schedule this report to run automatically: with prompt values as below:

It always picks up the pSnapshot_date= 2024-01-01 and passes the value to report to run, even when the Parameter1= 1.

But for the report to have right values, it should pick up pSnapshot_date= yesterday's date even if the prompt specifies a date from the scheduled run. I am not sure, if this is defect or can we write the query filter differently to achieve that?
Kind Regards,
Varshini
------------------------------
Varshini Niharika
Original Message:
Sent: Fri November 03, 2023 04:44 AM
From: Jan Geesen
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hi,
I made it with _add_days(date; ?dateprompt?) and set a default value 0. In my prompt selection I have an extra-query that shows dates but gives the differente to current_date to my prompt. I hope you understand my answer, if not feel free to contact me directly.
regards
Jan
------------------------------
Jan Geesen
Original Message:
Sent: Tue October 31, 2023 08:38 PM
From: Varshini Niharika
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hello David,
Thank you for reply with your inputs, Yes that would work too.
But I did you use this below IBM article and have applied an extra value prompt & static choices as 1 and 2, when 1 : Departure Date= current date and 2 uses the p_SnapshotDate other than current date. So, when scheduling I have defaulted parameter to be set to 1.
https://www.ibm.com/support/pages/how-pass-current-date-scheduled-report-prompt
Kind Regards,
Varshini
------------------------------
Varshini Niharika
Original Message:
Sent: Tue October 31, 2023 08:28 PM
From: David Hill
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hi Varshini,
We set a default value for the prompt (say 2099-12-12) and have the filter expression like
?p_SnapshotDate? = 2099-12-12 and [Departure Date] = current_date or [Departure Date] = ?p_SnapshotDate?
------------------------------
David
Original Message:
Sent: Mon October 30, 2023 03:17 AM
From: Varshini Niharika
Subject: How do I make default Date prompt to select Current_Date as default value for the Report
Hello Team,
Raising this question, I did try some options: default selection in value prompt is first value | Cognos Analytics (ibm.com) but was not successful.
The Issue here is the default date Parameter is coming from FM model package, which we cannot disable.
How do I make the default date prompt to select the current date, and run the report without prompt page, so I can schedule the report to run on daily basis without manual intervention.


where we need the values flow related to Departure Date, which is filtered at the present moment with the default snapshot date.


Kind Regards,
Varshini Niharika
------------------------------
Varshini Niharika
------------------------------