Parameterize your Model to avoid constants
Parameters can be added to two different locations within a Model, depending on the desired scope of the parameter:
Model Parameters list - Parameters added to this list are model-wide and can be used in any pipeline in the Model.
Data source - Parameters added to individual data sources can only be used in Pipelines originating from that data source.
Once defined, they can then be used in SQL expressions when creating calculated columns in Pipelines.
Add a Model Parameter
Model-level parameters are added using the Parameters list on the model's tab. These parameters can be used in any pipeline in the model.
Open an existing model.
Expand the Parameters section.
Collapse the design panel.
Click + Parameter. An undefined parameter is added to the existing list of parameters.
Define the parameter's settings:
In the Name column, specify a name. This setting will be used to identify the parameter in calculated columns.
In the Data Type column, specify the data type for the parameter using the corresponding drop-down.
In the Value column, define the value for the parameter.
(Optional) In the Description column, add text describing usage.
Click Save.
Add a Data Source Parameter
Data source-level parameters are added using the Parameters tab on an individual data source. These parameters can be used in pipelines that originate from the specific data source.
Open an existing model.
Expand the Data Sources section and open a data source.
On the data source's tab, click PARAMETERS.
Collapse the design panel.
Click + Parameter.
Define parameter settings:
In the Name column, specify a name. This setting will be used to identify the parameter in calculated columns.
In the Data Type column, specify the data type for the parameter using the corresponding drop-down.
In the Value column, define the value for the parameter.
(Optional) In the Description column, add text describing usage.
Click Save.
Use a Parameter
Once defined, you can add parameters to a calculated column in a pipeline.
Open an existing Model.
Expand the Pipelines section and select a pipeline.
Open or create a calculated column in a pipeline.
On the CALCULATION tab on the design panel, select Parameter and then select the parameter you want to use from the drop-down.
Click Apply.
Note
Parameters may also be added to the Value column of a condition in a pipeline Filter list.
Delete a Parameter
Delete a parameter by right-clicking it in the Parameters list (on the model tab), and selecting Delete from the menu.
Important
You cannot delete the TimeZone parameter.