Oracle Fusion Data Intelligence

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

Use Expression as Default for "Normal" String Filter

Accepted answer
12
Views
1
Comments

I would like to have the default value in a filter be based on an expression while still being able to use the selectable values from a normal string filter. To explain in more detail…

The Expression

We want to get the current accounting period as of one day ago as the default value for Fiscal Period (e.g., 2/1/2025 would be for the 1/31/2025 accounting period). We use the "Jan-25" format. As such, we use the following expression which yields a valid filter value for Fiscal Period.

MONTHNAME(CURRENT_DATE- 1)|| '-' || RIGHT(CAST(YEAR(CURRENT_DATE - 1) AS CHAR(4)), 2)

The Challenge

This filter works, but the user sees the full expression code when they click the filter rather than the available accounting periods (Jan-25, Feb-25, etc.)

We can use the default filter by drag and dropping, which displays the available periods. However, there does not appear to be a way to have it default based on the expression above as the "default" value must be selected from the available values (e.g. I can choose Feb-25 from the list, but I can't input an expression to arrive at Feb-25)

The Use Case

95% of the time users want to default to the current period minus a day so we want this as a default. We then want them to be able to override that as needed easily by clicking a different date rather than having to play in the expression filter.

Is there a way to accomplish the above, or not current possible? Thanks!

Best Answer

  • Polaiah-Oracle
    Polaiah-Oracle Rank 2 - Community Beginner
    Answer ✓

    Please perform below:

    1. Add fiscal period to the filters.
    2. Click the filter -> Click on (X) and click on Create Parameter.
    3. Go to parameters and set default value as Logical query.
    4. Provide a logical query to get the previous day.