Working with Runtime Parameters
Runtime parameters are user-defined fields whose values are requested when a workspace is loaded. Runtime parameters allow you to enter a value that is not contained in the data source and whose value may only be known at runtime, such as today's exchange rate. You can add runtime parameters as a new column to a table while preparing your data if you wish.
Runtime parameters are like regular fields:
-
they have field names and have specific data types
-
they can be used just like any other field in the formulas of calculated fields and filters
-
they can appear as a column in a table or be hidden.
The major difference between other fields and runtime parameters is that the user sets the value for the runtime parameter at the time the workspace is loaded, or set it while a session is in progress. If the workspace uses one or more runtime parameters, the user is presented with the Runtime Parameter Values dialog to enter parameter values. This same dialog box can be accessed at any time during the session via the Runtime Parameters tab in Application Default Settings or Current Workspace Settings.
Monarch Data Prep Studio supports two types of runtime parameters:
-
Application runtime parameters can be used by all tables in all workspaces within the application.
-
Workspace runtime parameters can only be used by all tables within the current workspace.
Creating application or workspace-wide runtime parameters
Steps:
-
Select Application Default Settings or Current Workspace Settings from Settings on the main menu.
-
Select the Runtime Parameters tab to display the Runtime Parameter definition tab.
-
Select the + icon to create a new parameter row.
-
Set the following:
-
Name
-
Data Type
-
Value (This value is optional. If you set a value now, this value is only valid during the current session. )
-
-
For parameters defined for the current workspace, check Apply to existing tables if you want the runtime parameter accessible to all tables in the workspace.
-
Repeat Steps 3-5 to add more runtime parameters.
Using runtime parameters in a table
Create a column using a runtime parameter.
Steps:
-
Go to Prepare and select the table you want to use the runtime parameter in.
-
Right-click on a column and select Columns > New Runtime Parameter Column.
-
Enter the name in the Output Column Name box.
-
Click the pencil icon to display the Runtime Parameters list:
-
Switch between the Application or Workspace tab to select application or workspace parameters and check the box beside the parameter you want to use. .
-
Click OK.
-
Use the new column in a calculated field, if needed.
The New Runtime Parameter dialog box displays:
At this point the runtime parameter becomes a new column in your table.
Notes: runtime parameters in calculated fields
-
The runtime parameter field will display on the Field List of the Create Calculated Field dialog box just like any other column.
-
Calculated field values are automatically updated if you change the value of the runtime parameters they use.
-
Calculated fields that use runtime parameters will have blank values if the runtime parameter is blank.
Setting a runtime parameter value
You can set your runtime parameter value in two ways:
-
By entering a value when you open the workspace.
-
By entering a value from Application Default Settings or Current Workspace Settings while a session is in progress.
Setting Parameters at Load Time
Steps:
-
Open the workspace. The Runtime Parameter Values dialog box displays.
-
Enter values for the runtime parameters. You must enter a value that matches the runtime parameter's data type.
-
You can leave the values blank. If you do so, the columns created with runtime parameters will also have blank values (and any calculated field that use them). You can enter runtime parameter values after a workspace is opened from Application Default Settings or Current Workspace Settings.
-
If you enter a value at this point, you can still change it at any time from Application Default Settings or Current Workspace Settings.
-
Select OK.
Note that:
Setting Parameters During a Session
Steps:
-
Select Application Default Settings or Current Workspace Settings.
-
Select the Runtime Parameters tab to display the Runtime Parameter definition tab:
-
Enter a value in the Value column. You must enter a value that matches the runtime parameter's data type.
-
Select OK to set the parameters value(s) and close Application Default Settings or Current Workspace Settings.