​​​​​​Want to make your dashboards more engaging and informative?

Dynamic text boxes in Oracle Analytics can transform static reports into interactive storytelling experiences. By combining parameters with SQL queries, you can create narrative descriptions that automatically update based on user selections.

In this article, we’ll create a dynamic title that displays total rocket launches and success rate for a selected time period, along with information about the top rocket launcher.

Example output:

1,500 rockets have been launched in the last 35 last years with an average of 94.2% success. The top rocket launcher is SpaceX, with 434 launches during this period.”

Dynamic text boxes
Dynamic text boxes

Prerequisites

Begin by enabling Developer Mode:

  1. Click the profile at the top-right corner of the page
  2. Select Advanced
  3. Toggle Enable Developer Options to on

Understanding the Parameter Structure

This implementation uses a two-tier parameter system:

  1. Root Filter Parameter – Acts as the primary control
    • Parameter users will interact with (in our case, the time window)
    • Serves as an input for all other parameters
    • Controls the data scope for the entire dashboard
  2. SQL Display Parameters – Dependent parameters that show values
    • These parameters contain SQL queries that use the Root Filter Parameter
    • Each represents a specific metric or attribute to display
    • Automatically updates when the Root Filter Parameter changes

Think of it as a tree structure:

RootFilter_Look Back Window
├── SQL_Launches (uses root filter in WHERE clause)
├── SQL_Success (uses root filter in WHERE clause)
├── SQL_Top Rocket Launcher (uses root filter in WHERE clause)
└── SQL_Top Rocket Launches (uses root filter in WHERE clause)

Step 1: Create the Root Filter Parameter

This is the foundation parameter that will drive all dynamic updates:

  1. Create the time filter:
    • Drag Date to the top filter
    • Click Relative Time
    • Click the (x) icon and select Create a Parameter on the Increment
    • Rename the parameter as RootFilter_Look Back Window
  2. Understand the role:
    • Stores the user’s selected time window
    • When changed, it triggers updates in all dependent SQL parameters
    • Acts as a single control point for the entire dynamic text system
RootFilter_Look Back Window
RootFilter_Look Back Window

Step 2: Generate SQL Queries

Create parameters that depend on the root filter:

  1. Create these visualizations to get base SQL queries:
    • Drag the measure #Launches to a Tile
    • Drag the measure #Success Rate to a Tile
    • Drag the attribute Rocket Launcher to a Table and filter it to Top 1 Rocket Launcher by #Launches
    • Drag the measure #Launches to a Table and filter it to Top 1 Rocket Launcher by #Launches
  2. Retrieve SQL queries:
    • Click the three dots at the top-right corner of the page and select Developer
    • In the Developer Console, click Refresh to view a table with your visualizations
    • Click on each visualization and copy its Logical SQL
  3. Modify the SQL queries:
    • Remove everything before SELECT
    • Remove 0 s_0,
    • Remove the last rows that are sorting or limiting the result: FETCH FIRST 500001 ROWS ONLY or ORDER BY 2 ASC NULLS LAST
    • Replace the hardcoded lookback period with the parameter: @parameter(“RootFilter_Look Back Window”)

Before/After SQL example:

Original SQL:

SET VARIABLE OBIS_REFRESH_CACHE=1,QUERY_SRC_CD=’Visual Analyzer’,SAW_SRC_PATH='{“viewID”:”view!33″,”currentCanvas”:”canvas!7″,”path”:”/%40
Catalog/users/patrick.goubet%40oracle.com/Dynamic%20Text%20Boxes”}’,
ENABLE_DIMENSIONALITY = 1; SELECT
   0 s_0,
   XSA(‘patrick.goubet@oracle.com’.’Space Launches’).”Space_Launches”.”Launches” s_1
FROM XSA(‘patrick.goubet@oracle.com’.’Space Launches’)
WHERE
((XSA(‘patrick.goubet@oracle.com’.’Space Launches’).”Space_Launches”.”Date” > (TIMESTAMPADD(SQL_TSI_YEAR, -70, CURRENT_TIMESTAMP))) AND (XSA(‘patrick.goubet@oracle.com’.’Space Launches’).”Space_Launches”.”Date” <= (CURRENT_TIMESTAMP)))
FETCH FIRST 500001 ROWS ONLY

Modified SQL:

SELECT

XSA(‘patrick.goubet@oracle.com’.’Space Launches’).”Space_Launches”.”Launches” s_1

FROM 

XSA(‘patrick.goubet@oracle.com’.’Space Launches’)

WHERE

((XSA(‘patrick.goubet@oracle.com’.’Space Launches’).”Space_Launches”.”Date” > (TIMESTAMPADD(SQL_TSI_YEAR, –@parameter(“RootFilter_Look Back Window”), CURRENT_TIMESTAMP)))

AND

(XSA(‘patrick.goubet@oracle.com’.’Space Launches’).”Space_Launches”.”Date” <= (CURRENT_TIMESTAMP)))

 

Retrieve SQL queries
Retrieve SQL queries

Step 3: Create SQL Display Parameters

  1. On the left panel, click (x), then select Create a Parameter
  2. Configure the parameter:
    • Name: Enter an appropriate name
    • Data Type:
      • Select Integer for whole numbers and toggle Format Numbers to on
      • Select Double for decimals and toggle Format Numbers to on
      • Select Text for categorical attributes
      • Initial Value: Paste in the modified Logical SQL query
  3. Click OK.
SQL_Launches
SQL_Launches

Step 4: Build the Dynamic Text Box

Combine all parameters to create your dynamic narrative:

@parameter(“SQL_Launches”) Rockets have been launched in the last @parameter(“RootFilter_Look Back Window”) Last Years With an average of @parameter(“SQL_Success”)% Success. The Top Rocket Launcher is @parameter(“SQL_Top Rocket Launcher”), with @parameter(“SQL_Top Rocket Launches”) launches on this period.

Parameter Flow Example:

  1. Change Look Back Window to 25 years
  2. Change RootFilter_Look Back Window updates to 25
  3. All SQL parameters automatically recalculate:
    1. SQL_Launches retrieves launches for past 25 years
    2. SQL_Success calculates success rate for past 25 years
    3. etc…
  4. Text box updates with all new values

This structure ensures that a single filter control can update multiple data points in your narrative, maintaining consistency across your dashboard while providing dynamic, real-time insights.

Call to Action

By implementing dynamic text boxes with parameters in Oracle Analytics, you can transform static dashboards into engaging, interactive experiences that tell your data’s story more effectively. This approach not only makes your dashboards more user-friendly but also ensures that your narrative stays consistent and up to date with user interactions.

You can find the dva file shown in this article here.

Ready to take your Oracle Analytics dashboards to the next level? Learn more about parameters in the Create and Use Parameters documentation.

Now that you’ve read this article, try it yourself and let us know your results in the Oracle Analytics Community, where you can also ask questions and post ideas.