7 Setting Up the Analytic Model
7.2 Creating Views
7.2.9 Creating Input Parameters
Use this procedure to allow you to provide input for the parameters within stored procedures, in order to obtain a desired functionality when the procedure is executed.
In an analytic view you use input parameters as placeholders during currency conversion and formulas like calculated columns. When used in formulas, the calculation of the formula is based on the input that you provide
at runtime during data preview. Input parameters are not used for filtering attribute data in analytic views that can be achieved using variables.
In calculation views you can use input parameter during currency conversion, calculated measures, input parameters of the script node, and to filter data as well.
You can apply input parameters in analytic and calculation views. If a calculation view is created using an analytic view with input parameters, those input parameters are also available in the calculation view but you cannot edit them.
The following types of input parameters are supported:
Type Description
Attribute Value/ Column Use this when the value of a parameter comes from an attribute.
Currency (available in Calculation View only) Use this when the value of a parameter is in a currency format, for example, to specify the target currency during currency conversion.
Date (available in Calculation View only) Use this when the value of a parameter is in a date format, for example, to specify the date during currency conversion. Static List Use this when the value of a parameter comes from a user-
defined list of values. Derived From Table (available in Analytic View and Graphical
Calculation View)
Use this when the value of a parameter comes from a table column based on some filter conditions and you do not need to provide any input at runtime.
Empty Use this when the value of a parameter could be anything from the selected data type.
Direct Type (available in Analytic View) Use this to specify an input parameter as currency and date during currency conversion.
In the case of analytic views, all input parameters are mandatory. However, in the case of calculation views, each type of input parameter can be either mandatory or non-mandatory. For a mandatory input parameter, it is necessary to provide a value at runtime. However, for a non-mandatory input parameter, if you do not specify a value at runtime, the data for the column in which the input parameter is used remains blank.
Note
You can check whether an input parameter is mandatory or not from the properties of the input parameter in the Properties pane.
Example
● If you want to create a formula to analyze the annual sales of a product in various regions, you can use Year and Region as input parameters.
● If you want to preview a sales report with data for various countries in their respective currency for a particular date for correct currency conversion, you can use Currency and Date as input parameters.
Procedure
Analytic View
1. In the Output panel of the Data Foundation or Logical Join node, right-click the Input Parameters node.
Note
You can also create input parameters at the Semantics node level, using the Create Input Parameter option in the Variables/Input Parameters panel.
2. From the context menu, choose New. a. Enter a name and description.
b. Select the type of input parameter from the Parameter Type dropdown list.
Note
○ For the Column type of input parameter, you need to select the attribute from the dropdown list. At runtime the value for the input parameter is fetched from the selected attribute's data.
○ For an input parameter of type Derived from Table, you need to select a table and one of it's column as Return Column whose value is then used as input for the formula calculation. You can also define conditions to filter the values of Return Column in the Filters panel. For example, to calculate Discount for specific clients, you can create an input parameter based on Sales table and return column Revenue with filter set on the Client_ID.
○ For Direct Type input parameter, specify the Semantic Type that describes the use parameter as a currency or date, for example, to specify the target currency during currency conversion.
c. If required, select a data type.
d. Enter length and scale for the input parameter. e. Choose OK.
Calculation View
1. In the Output panel, right-click the Input Parameters node. 2. From the context menu, choose New.
a. Enter a name and description.
b. Select the type of input parameter from the dropdown list.
Note
○ For the Attribute Value type of input parameter, you need to select the attribute from the
dropdown list. At runtime the value for the input parameter is fetched from the selected attribute's data.
○ For an input parameter of type Derived from Table, you need to select a table and one of it's column as Return Column whose value is then used as input for the formula calculation. You can also define conditions to filter the values of Return Column in the Filters panel. For example, to
calculate Discount for specific clients, you can create an input parameter based on Sales table and return column Revenue with filter set on the Client_ID.
c. Select a data type.
d. Enter length and scale for the input parameter. e. Choose OK.