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?
- Access to Oracle Analytics
- Download sample_order_lines2023.xlsx to your computer
Create a Dataset
In this section, you add the sample_order_lines2023.xlsx
file to Oracle Analytics to create a dataset table.
- Sign in to Oracle Analytics.
- On the Home page, click Create, and then click Dataset.
- In Create Dataset, click Drop data file here or click to browse, select the sample_order_lines2023.xlsx file, and then click Open.
- In Create Dataset Table from sample_order_lines2023.xlsx, click OK. Click Save
.
- In Save Dataset As, enter
sample_order_lines2023
, and then click OK.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.
- Click Create Workbook.
- Click Parameters
. Click Add
. In Create Parameter, enter
Cost Increase %
in Name. - Click Text in the Data Type row and select Integer.
- From the Available Values list, select Range. In Min Value enter
0
. In Max Value enter100
. - In Initial Value, enter
0
. Click OK.Oracle Analytics add the Cost Increase % parameter to the Parameters list under the system parameters.
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.
- Click Data
.
- In the Data panel, right-click the My Calculations folder, and then select Create Calculation.
- In New Calculation, enter
Projected Cost Increase
in Name. - In the calculation field, enter
Shi
, select Shipping Cost from the list. Click Show available Functions, expand Operators, and then select add (+), enterShi
, and then select Shipping Cost. From the Operators list, double-click multiply (*). - Click Parameters
, drag the Cost Increase % parameter to the expression field, and then enter zero (
0
) in the default value field. - Click Validate. Click Save.
Your calculation expression should look like the following:
Shipping Cost + Shipping Cost * @parameter("Cost Increase %")(0)
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.
- 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 the illustration bar_visualization.png - 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 the illustration projected_cost_incr.png - Click Parameters
. 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 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 the illustration 5percent_incr.png - In the visualization, click Cost Increase 5%. Enter
1
to change the percent to a lower cost increase.Description of the illustration update_cost_percent.png - Press ENTER.
Description of the illustration one_percent.png - Click Save. In Save Workbook, enter
What if Shipping Cost
in Name, and then click Save. - Click Go Back
.
Review the What-if Scenario
In this section, you view the visualization in its consumer view mode to verify that it works as expected.
- On the Home page, hover over the What if Shipping Cost workbook, click Actions
, and then select Open.
- Click 0%, enter a value in the Cost Increase % field, and then press ENTER.
Description of the illustration consumer_view.png
Learn More
Create What-If Analysis Using Parameters in Oracle Analytics
F79579-03
May 2024
Learn how to create a parameter that enables users to perform what-if type analysis or forecasting analysis using an input value in Oracle Analytics.
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or "commercial computer software documentation" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms governing the U.S. Government's use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.