Introduction
Modelers can specify rule parameters to pass values to SQL rules. Rule parameters are particularly useful when a rule requires end-user input. This article demonstrates how to add rule parameters.
Add Parameter
1. Go to the Modeler and select the target SQL rule.
Tip: If you do not know how to create a SQL rule, refer to this article.
2. Select Edit and go to the Parameter tab.
3. Select Add to create a new parameter.
4. Enter a Parameter Name (used for SQL definition) and a Display Name (user-friendly name).
5. From the Type dropdown, select a parameter type:
- Float: Pass numeric values to the SQL rule.
- String: Pass text values to the SQL rule.
- Member Picker: Pass selected member(s) from a controlled list to the SQL rule, rather than a typed value.
6. Configure type-specific settings.
7. Select OK.
The window should close, and you should see your parameter added. You can start using the parameter(s) in the SQL rule.
Tip: You can edit a parameter's definition by selecting the gear icon under the Edit column.
Type-specific settings
This section explains how to configure settings for the different parameter types.
Float
Below are specific settings for the Float parameter type.
Format
Specify the parameter's display format:
- Default/Standard: The rule will treat the value as is (1 as 1).
- Percent: The rule will treat the value as a percentage (1 as 1%).
Default (Optional)
Specify a default value for the parameter. If nothing is specified, the input box for the parameter will be blank when the rule window is opened.
Here is an example of the SQL rule with a float parameter:
String
Below are specific settings for the String parameter type.
Character Limit (optional)
Specify a character limit on strings. If left empty, there is no character limit.
Default (optional)
Specify a default value for the parameter. If nothing is specified, the input box for the parameter will be blank when the rule window is opened.
Height
The default height of a string input box is 25 px. Customize the height of the input box by changing this value.
Here is an example of the SQL rule with a string parameter:
Member Picker
Below are specific settings for the Member Picker parameter type.
Dimension and Hierarchy
Select the relevant dimension for the parameter from the Dimension and Hierarchy dropdowns. These selections define the controlled list users will choose from.
Member (Optional)
Select a default member for the parameter. If nothing is specified, users will see "Please select..." in the dropdown.
Multi-select
This option allows users to choose multiple members.
(Leaves Only) Selectable
This option restricts users from picking only leaf-level members.
(All) Non-Selectable
This option prevents users from choosing the All dimension member.
Here is an example of the SQL rule with a member picker parameter: