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

Work arounds on date prompts

Started by sriYA, 16 Jun 2020 09:25:59 AM

Previous topic - Next topic

sriYA

I need some help with dates

There is a date prompt on a report.
•   When the user enters a custom date the report should display prompt date.
•   When the user leaves the date blank on the prompt page then it should pick up the data item value from the report.

I used Case when ?promptDt? is null then [Invoice_Date] else ?propmtDt? end

My issue is, as soon as I add this code the date on the prompt page turns into mandatory.
The users want this to be blank.

TIA

hespora

Using the ?name? syntax to reference parameters will indeed make the corresponding prompts mandatory. You need a prompt macro with default value instead.

Change your data item to:

#prompt( 'promptDt', 'token', '[Invoice_Date]' )#

Cape Cod Gunny

You could create a prompt page with a single Date Prompt. Set Date Prompt Required = False. Filter the report using the Date=?Date Prompt? and make the filter "optional".
Michael Riley
Marine Corps Gunnery Sergeant (Retired)

"We may never pass this way again!"

hespora

His/her usage of the parameter was in a data item rather than a filter. There's no making those optional. ;)

aetcognos

Quote from: hespora on 18 Jun 2020 10:31:03 AM
Using the ?name? syntax to reference parameters will indeed make the corresponding prompts mandatory. You need a prompt macro with default value instead.

Change your data item to:

#prompt( 'promptDt', 'token', '[Invoice_Date]' )#

Yes this should work, although I would change it to date instead of token, and you would get an optional date prompt when viewing tabular data or  running a report.

#prompt( 'promptDt', 'date', '[Invoice_Date]' )#