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.

  1. Open an existing model.

  2. Expand the Parameters section.

  3. Collapse the design panel.

  4. Click + Parameter. An undefined parameter is added to the existing list of parameters.

  5. Define the parameter's settings:

    1. In the Name column, specify a name. This setting will be used to identify the parameter in calculated columns.

    2. In the Data Type column, specify the data type for the parameter using the corresponding drop-down.

    3. In the Value column, define the value for the parameter.

    4. (Optional) In the Description column, add text describing usage.

  6. 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.

  1. Open an existing model.

  2. Expand the Data Sources section and open a data source.

  3. On the data source's tab, click PARAMETERS.

  4. Collapse the design panel.

  5. Click + Parameter.

  6. Define parameter settings:

    1. In the Name column, specify a name. This setting will be used to identify the parameter in calculated columns.

    2. In the Data Type column, specify the data type for the parameter using the corresponding drop-down.

    3. In the Value column, define the value for the parameter.

    4. (Optional) In the Description column, add text describing usage.

  7. Click Save.

Use a Parameter

Once defined, you can add parameters to a calculated column in a pipeline.

  1. Open an existing Model.

  2. Expand the Pipelines section and select a pipeline.

  3. Open or create a calculated column in a pipeline.

  4. On the CALCULATION tab on the design panel, select Parameter and then select the parameter you want to use from the drop-down.

  5. 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.