Templates
Templates are custom and out-of-the-box reusable rules that are ideal for rules that apply to more than one dataset. Because Templates are dataset independent, you can write a rule once and then run it against any dataset in your Collibra DQ environment as many times as necessary. This can eliminate the need to write new rules for frequently used compliance checks from one dataset to the next, and can also reduce the amount of time you spend writing complex rules, such as ones that include regex and cast operations.
The Templates page shows a list of all template rules in your Collibra DQ environment and lets you add new ones with the Add Rule Template wizard.
Adding a Template Rule
- On the sidebar menu, click Rules, then click Templates. The Templates page opens.
- In the upper right corner of the Templates page, click Add Rule Template. The Add Rule Template form opens.
- Enter the required information.
- Click Save.
- Your template rule is available on the Templates page and on the Rule Workbench when you select it from the Templates section of the Type dropdown menu.
Option | Description | Required |
---|---|---|
Name | The name of your template rule. Enter a unique name to easily identify your template rule. |
Yes |
Type |
The rule type of your template rule. Only Simple and Freeform are eligible rule types for templates. Select an option from the dropdown menu. Note If you select Freeform (SQLF), you can use a more complex SQL expression that includes regex, but the validation function will be unavailable. |
Yes |
Is Regex? |
Select this option if the Value field contains a regular expression (regex). When you select Is Regex, the Type is SQLG and contains just the regex value, and neither Important
|
No |
Value/Regex |
The query or regex that your rule template applies to run against a dataset. Enter a query or expression for your rule template to run against a dataset. Note Value displays when Is Regex is not selected, and Regex displays when Is Regex is selected. |
Yes |
Input/Validate Input |
Because regex treats inputs as one continuous string, the input field informs the system to treat each line separately. Optionally enter a value or a comma delimited list of values, then click Validate Input to test them against your regex. Note Input only displays when Is Regex is selected. |
No |
Description | The description that helps identify your template rule. It is best practice to base your description on what the Value field queries. |
No |
Using a Template Rule on the Rule Workbench
To use a data class rule to run against a dataset, follow these steps.
- Click the in the sidebar menu, then click Rule Builder. The Dataset Rules page opens.
- There are two ways to open the Rule Workbench.
- Click the Type dropdown menu and scroll down to the Template section, then select your Template rule. The Template rule populates in the query builder.
- Enter a name for your rule in the Rule Name input field.
- Select a primary column from the Primary Col dropdown menu.
- Optionally click to add a secondary dataset.
- Enter the name of your secondary dataset in the search bar when the Add Secondary Dataset dialog appears, then click Add Secondary Dataset.
- Click Validate to validate your expression.
- Optionally click Beautify to format your SQL query in a more readable layout.
- Click Save to apply your rule to your dataset.
Important Rule names cannot contain spaces.
Note Primary Column is required when you use Template rules.
Out-of-the-box Templates
Collibra DQ has 12 out-of-the-box (OOTB) templates for common rule checks. OOTB templates cannot be edited or deleted.
Name | Value | Description |
---|---|---|
DECIMAL_3_rule |
|
The rule breaks when a column value does not contain a sequence of 3 digits before a decimal, and three digits after the decimal. |
Having_Count_Greater_Than_One |
|
Checks if the count of an exact match value occurs more than once. |
is_DATE |
|
The rule breaks when a column value is not in YYYY-MM-DD format. |
less_than_200 |
|
Checks for any column values less than 200. |
Not_In_Current_run |
|
Checks if column values are not present in the current run. |
Not_In_Previous_run |
|
Checks if column values are not present in the previous run. |
Percent_Move_5 |
|
Checks if there are column values present that are 5% greater or less than the average value in that column. |
Percent_Move_10 |
|
Checks if there are column values present that are 10% greater or less than the average value in that column. |
Percent_Move_20 |
|
Checks if there are column values present that are 20% greater or less than the average value in that column. |
Percent_Move_50 |
|
Checks if there are column values present that are 50% greater or less than the average value in that column. |
Two_Decimal_Places |
|
Checks if the column decimal place precision exceeds a length of 2. |
USTAX_rule |
|
The rule breaks when the specified column does not contain "USTAX". |