Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to use current date in a parameter

Received Response
20
Views
1
Comments

Hello,

I am building some workbooks using OAC and OAS. I understand I can use system parameters as current date but how can I create a user defined parameter that is current date-3 (3 days ago) for example. I know I can easily create a calc to return current date and or current date -3 but instead of using calc as the filter I wanted to pass the parameter in my filter control and default the dates to what I wanted. For current date it's not a problem but I don't know how to do the same for current date 3 days ago.

ultimately, I want to be able to bind those parameters to my data set columns so the initial value gets populated correctly.

Thanks

Syed

Answers

  • Aman Jain-Oracle
    Aman Jain-Oracle Rank 6 - Analytics & AI Lead

    Hi Syed, Thanks for posting your question.

    You can create a new date parameter that defaults to the current date minus three days, set the Initial Value to the Logical SQL query, something like below:

     SELECT TIMESTAMPADD(SQL_TSI_DAY, -3, CURRENT_DATE)  FROM "Subject Area"
    

    you can then use this parameter the way you want in your workbook, this would return date minus three days.

    Hope this helps!