Oracle Analytics Cloud and Server

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

In OAC how to set last month's first day to a filter

Accepted answer
254
Views
6
Comments

I have a datetime filter with a start date, but I want it to default to the first day of last month. How can I make this happen?

I created a calculation using TIMESTAMPADD(SQL_TSI_MONTH, -1, CURRENT_DATE) and assigned it as the filter, but it's not affecting the visuals.

Best Answer

  • HI @User_TUWA3 ,

    You are using a calculated column to initialise the available values for the parameter, not as a default selection (Initial Value is blank, so nothing is selected by default).

    You should proceed as follows:

    • Get the logical SQL generated by your calculation. You can add a table with your calculated column in it, and use Developer Options to see the generated logical SQL.
    • Change Initial Value to Logical SQL Query in your parameter definition, and paste the query that corresponds to your calculated column
    • Bind the parameter to the start value of your filter

    Please note that your current calculation is not going to return the first day of last month, but today's date minus one month.

Answers