IBM Support

How to make a date prompt empty by default in Cognos Analytics

Question & Answer


Question

By default, the date prompt displays the current date. How can you make the date prompt appear blank by default?

Answer

Steps:

1. Open Cognos Analytics in a browser.

2. Select  New and select the Report option.

3. Choose any template for the report and select OK’.

4. Select the Toolbox icon in the left side panel.

5. Expand the PROMPTING option and drag the Date prompt to the report.

6. Select Finish’.

7. Select the Date Prompt and click on the Properties icon in the top right corner of the screen.

8. Under properties, change the option SELECT UI from “Calendar” to “Edit Box”. Also, from the Properties window change the Miscellaneous Nameto ‘DatePrompt’.

9. Expand the ADVANCED option in the toolbox panel.

10. Drag the HTML ITEM and drop it to the right of the Date Prompt.

11. Select the ellipsis(three dots) for the HTML item and choose the Edit HTML option.

12. A ‘HTML’ dialog box opens. Enter the following JavaScript in the HTML dialog box:

<script language="javascript">
var formWR = getFormWarpRequest();
var dateTxtPrompt = formWR.txtDateDatePrompt
dateTxtPrompt.value=' ';
</script>

13. Set the Report property Run with full interactivity = No 

14. Run the report and you should be able to see the date prompt with an empty value.

 

[{"Product":{"code":"SSTSF6","label":"IBM Cognos Analytics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
31 October 2022

UID

swg22009608