Before you Begin

This tutorial shows you how to pass parameter values in a URL in Oracle Analytics.

Background

In Oracle Analytics, you can create a workbook with parameters bound to filters and then pass the parameter values to a workbook, a report, or an application. You might want to share the parameter values in the workbook with another user who has access to the workbook. You can pass parameters to yourself to provide a personalize view of a shared workbook.

What Do You Need?

Create a Dataset

In this section, you create a dataset using the sample_order_lines2023.xlsx file.

  1. Sign in to Oracle Analytics.
  2. On the Home page, click Create, and then click Dataset.
  3. In Create Dataset, click Drop data file here or click to browse.
  4. In Create Dataset Table from sample_order_lines2023.xlsx, click OK.
  5. Click Save Save icon. In Save Dataset As, enter sample_order_lines2023, and then click OK.


    Description of sample_order_lines2023.png follows
    Description of the illustration sample_order_lines2023.png

Create a Workbook and Visualization

In this section, you create a workbook and visualization to pass parameter values in Oracle Analytics.

  1. Click Create Workbook.
  2. Close Auto Insights.
  3. In the Data Data panel icon pane, hold down the Ctrl key and select Sales, Profit, Customer Segment, and City. Right-click and select Create Best Visualization.


    Oracle Analytics generates a scatter visualization. The results of the generated visualization depend on how the data elements were selected. You can move the data elements within the grammar pane.

    Description of scatter_vis.png follows
    Description of the illustration scatter_vis.png
  4. In the visualization, click Change Visualization Type Change Visualization Type icon and select Horizontal Bar Horizontal Bar icon.
  5. In the Grammar pane, select Sales and drag it to the Values (X-Axis) under Profit.
  6. In the Grammar pane, select Customer Segment and drag it to Category (Y-Axis) under City.


    For this example, you want Sales and Profit to end up in the X-Axis after you move the data elements in the next steps, and Customer Segment and City in the Y-Axis.

    The horizontal bar shows the negative profit values as lines pointing toward the left.

    Description of horizontal_bar_vis.png follows
    Description of the illustration horizontal_bar_vis.png
  7. Click Save. In Save Workbook, enter a Name, and then click Save.

Bind the Parameters to Filters

In this section, you create filters using the City and Customer Segment data elements and bind parameters to the filters.

  1. In the Data pane, select City and drag it to Filters in the Grammar pane.
  2. In the Filter dialog, select:
    • Albany
    • Bangalore
    • Barcelona
    • Denver
    • Hamburg
    • Istanbul
  3. Click Bind to Parameter Bind to parameter icon. Click Create Parameter and then click outside of the dialog.
  4. In the Data pane, select Customer Segment and drag it to Filters in the Grammar pane to join the City data element.
  5. In the Customer Segment filter, select Corporate and Small Business. Click Bind to Parameter Bind to parameter icon. Click Create Parameter and then click outside of the dialog.


    Description of city_segment_filter.png follows
    Description of the illustration city_segment_filter
  6. Click Save. Click Go back Go back icon to close the workbook.

Copy and Modify the Workbook URL

In this section, you get the URL for the workbook's project.jsp page, and update it with the parameter values.

  1. On the Home page, hover over the workbook you created in the previous section, click Actions Actions menu icon, and then select Open in a New Tab.
  2. Copy the URL for the workbook and paste it in a text editor.


    The URL must contain project.jsp in its path.

    Description of url_projectjsp.png follows
    Description of the illustration url_projectjsp.png
  3. In the text editor, define the select a different set of cities and customer segments to use as parameters and their values, similar to the following:
    • &p1n=Customer Segment
    • &p1v=Consumer,Home Office
    • &p2n=City
    • p2v=Glasgow,Houston,Johannesburg,Madrid,Hong Kong
  4. Copy the parameter variables to a single line and replace the commas and the spaces as follows:
    • Replace commas with %2C
    • Replace spaces with %20

    Your encoded parameter values should look similar to:

    &p1n=Customer%20Segment&p1v=Consumer%2CHome%20Office&p2n=City&p2v=Glasgow%2CHouston%2CJohannesburg%2CMadrid%2CHong%20Kong

  5. Append the parameter variables to the end of the path.


    Your URL should look similar to:

    Description of embedded_param_values.png follows
    Description of the illustration embedded_param_values.png
  6. Copy the encoded URL and paste it in the address bar of a browser.


    The horizontal bar visualization opens in the browser with the parameter values that you passed.

    Description of updated_parameters.png follows
    Description of the illustration updated_parameters

Learn More