Before You Begin

In this tutorial, you create a parameter that enables users to perform what-if type analysis or forecasting analysis in Oracle Analytics.

Background

You create a workbook using the sample_order_lines2023 dataset and add a bar visualization showing shipping cost by ship mode. When using a parameter in a workbook, you can create what-if scenarios of the increases in shipping cost as a way to see the impact of those changes on the various ship modes.

In this tutorial, you create a parameter, create a calculation using the parameter, and then apply the parameter to the workbook's bar visualization as a filter.

What Do You Need?

Create a Dataset

In this section, you add the sample_order_lines2023.xlsx file to Oracle Analytics to create a dataset table.

  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, select the sample_order_lines2023.xlsx file, and then click Open.
  4. In Create Dataset Table from sample_order_lines2023.xlsx, click OK. Click Save Save icon.
  5. In Save Dataset As, enter sample_order_lines2023, and then click OK.


    Description of sample_order_lines.png follows
    Description of the illustration sample_order_lines.png

Create a Parameter

In this section, you create a parameter that uses an Integer as the data type and accepts a range of possible values from 0 to 100. This parameter doesn't use multiple values or an alias.

  1. Click Create Workbook.
  2. Click Parameters Parameters icon. Click Add Add icon. In Create Parameter, enter Cost Increase % in Name.
  3. Click Text in the Data Type row and select Integer.
  4. From the Available Values list, select Range. In Min Value enter 0. In Max Value enter 100.
  5. In Initial Value, enter 0. Click OK.


    Oracle Analytics add the Cost Increase % parameter to the Parameters list under the system parameters.

    Description of cost_increase_param.png follows
    Description of the illustration cost_increase_param.png

Create a Calculation with the Parameter

In this section, you create a calculation with the parameter to enable the parameter's use in a what-if scenario.

  1. Click Data Data panel icon.
  2. In the Data panel, right-click the My Calculations folder, and then select Create Calculation.
  3. In New Calculation, enter Projected Cost Increase in Name.
  4. In the calculation field, enter Shi, select Shipping Cost from the list. Click Show available Functions, expand Operators, and then select add (+), enter Shi, and then select Shipping Cost. From the Operators list, double-click multiply (*).
  5. Click Parameters Parameters icon, drag the Cost Increase % parameter to the expression field, and then enter zero (0) in the default value field.
  6. Click Validate. Click Save.


    Your calculation expression should look like the following: Shipping Cost + Shipping Cost * @parameter("Cost Increase %")(0)

    Description of calculation_exp.png follows
    Description of the illustration calculation_exp.png

Create a Visualization

In this section, you create a visualization of shipping cost, the projected cost increase, and the ship mode. You connect the parameter to the visualization as a filter control.

  1. In the Data panel, hold down the CTRL key, select Shipping Cost and Ship Mode, and then drag them to the canvas.


    Oracle Analytics automatically creates a bar visualization.

    Description of bar_visualization.png follows
    Description of the illustration bar_visualization.png
  2. Under My Calculations, select Projected Cost Increase, drag it to Values (Y-axis), and release it under Shipping Cost.


    The default value for the Projected Cost Increase is zero (0) as a result matches the Shipping Cost values in the bar visualization.

    Description of projected_cost_incr.png follows
    Description of the illustration projected_cost_incr.png
  3. Click Parameters Parameters icon. Select Cost Increase % and drag it to Filters in the Grammar pane. In the Cost Increase % field, enter 5 for five percent cost increase. Click outside of the Cost Increase field.


    Description of cost_increase_percent.png follows
    Description of the illustration cost_increase_percent.png


    The Projected Cost Increase parameter shows the shipping cost increase to five percent for each shipping mode.

    Description of 5percent_incr.png follows
    Description of the illustration 5percent_incr.png
  4. In the visualization, click Cost Increase 5%. Enter 1 to change the percent to a lower cost increase.


    Description of update_cost_percent.png follows
    Description of the illustration update_cost_percent.png
  5. Press ENTER.


    Description of one_percent.png follows
    Description of the illustration one_percent.png
  6. Click Save. In Save Workbook, enter What if Shipping Cost in Name, and then click Save.
  7. Click Go Back Go Back icon.

Review the What-if Scenario

In this section, you view the visualization in its consumer view mode to verify that it works as expected.

  1. On the Home page, hover over the What if Shipping Cost workbook, click Actions Actions menu icon, and then select Open.
  2. Click 0%, enter a value in the Cost Increase % field, and then press ENTER.


    Description of consumer_view.png follows
    Description of the illustration consumer_view.png

Learn More