Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  Changing the Default Value on a Date Prompt to 'Yesterday'

    Posted Fri July 21, 2023 02:23 PM

    Does anyone know a way to set a dynamic value for the default selection for a 'Date Prompt' that does not include using an HTML item? I am not seeing the option to add a static choice in the properties pane. When I go to select a default value, it wants me to pick a date from a calendar instead of a blank text box where I could specify a dynamic value to represent yesterday. 

     Thanks in advance, 



    ------------------------------
    Elizabeth Johnson
    ------------------------------


  • 2.  RE: Changing the Default Value on a Date Prompt to 'Yesterday'

    Posted Sat July 22, 2023 06:48 AM

    Hi Elizabeth,

    which version of Cognos Analytics do you use? If it's V12, then there's a new feature for dynamic default values for prompts.

    If you don't use V12, then you might have to tweak around the data values to get a dynamic parameter value. I usually do that by setting the data value to a distinct value that will never come from the data source (like "-1") and set this as default value in the prompt. In the query for the prompt, I then use an if-statement to replace the real data value with "-1" if it's the desired default value. Haven't tried that with date prompts a I use drop-down or checkbox prompts.

    You can find some more explanations here:

    https://community.ibm.com/community/user/businessanalytics/discussion/default-selection-in-value-prompt-is-first-value



    ------------------------------
    Robert Dostal
    Team Leader BI
    GEMÜ
    Ingelfingen
    ------------------------------



  • 3.  RE: Changing the Default Value on a Date Prompt to 'Yesterday'

    Posted Tue July 25, 2023 09:16 AM

    We have to have a report that is compatible with Cognos 11.0.13.  

    I will look into replicating the answer found in the other thread. 



    ------------------------------
    Elizabeth Johnson
    ------------------------------



  • 4.  RE: Changing the Default Value on a Date Prompt to 'Yesterday'

    Posted Wed July 26, 2023 02:31 AM

    Cognos 11.0.13 isn't supported anymore by IBM. Consider upgrading to release 12 or at least 11.2.4 FP2



    ------------------------------
    Michiel Schakel
    ------------------------------



  • 5.  RE: Changing the Default Value on a Date Prompt to 'Yesterday'

    Posted Thu July 27, 2023 10:13 AM

    I was able to follow these steps, but I am still have issues with the default selections option for a date prompt. I am not able to specify the '-1' value. I am still only allowed to pick a specific date. I am having the same issue on Cognos 11.1.7.  



    ------------------------------
    Elizabeth Johnson
    ------------------------------



  • 6.  RE: Changing the Default Value on a Date Prompt to 'Yesterday'

    Posted Thu July 27, 2023 10:36 AM

    Hi Elizabeth,

    my solution with the "-1" value does not work with date prompts. Only value or text prompts are supported unfortunately. I know that there are solutions with java script out there that support the Cognos date prompt item. 



    ------------------------------
    Robert Dostal
    Team Leader BI
    GEMÜ
    Ingelfingen
    ------------------------------