With DataWorks Data Quality, you can create a library of reusable rule templates to centrally manage custom rules and improve configuration efficiency.
Prerequisites
The Rule Template Library feature is available in DataWorks Enterprise Edition and later editions.
Background information
You can create, manage, and apply rule templates in the Rule Template Library.
Usage notes
Changes to a custom rule template affect only tasks that use the template after the modification. Existing tasks that use the original template are unaffected.
Create a custom rule template
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Data Quality.
-
In the left-side navigation pane, choose .
-
Click the
icon and select Create Folder. -
In the Create Folder dialog box, enter a Name, select a destination folder, and then click Confirm.
-
In the left-side directory, right-click the folder name and select Create Rule Template.
You can also Rename or Delete the folder.
-
In the Create Rule Template dialog box, configure the parameters.
Parameter
Description
Template Name
Enter a name for the custom rule template.
Field
Currently, only Custom SQL is supported.
Sampling Method
Currently, only Custom SQL is supported.
Set Flag
Enter any
setstatements to execute before the SQL query.NoteSeparate multiple statements with commas (,). Do not add a semicolon (;) at the end of each statement.
Check Type
The supported check types are Numeric Type and Fluctuation Rate Type.
Verification Method
The available verification methods vary based on the selected check type:
-
When the Numeric Type is Check Type, the only available verification method is Compare with a specified value.
The SQL query must return a single value, such as a result from a COUNT or SUM operation, for comparison with the specified value.
-
When the Fluctuation Rate Type is Check Type, the following verification methods are available:
-
7-day average fluctuation
-
30-day average fluctuation
-
1-day period comparison
-
7-day period comparison
-
30-day period comparison
-
7-day variance fluctuation
-
30-day variance fluctuation
-
1-, 7-, and 30-day fluctuation detection
-
Previous-period comparison
-
Custom SQL
Enter the SQL query. You can use the ${tableName} variable to represent the table name.
NoteThe result of the Custom SQL query must be a single value (one row and one column) for comparison with a specified value.
Location
Select the folder in which you want to store the custom rule template.
-
-
Click Confirm.
Manage rule templates
Click the name of a rule template to View, Edit, Delete, or Copy it.
|
Actions |
Description |
|
View |
You can view the parameter configuration, Application List, and View Log for the rule template:
|
|
Edit |
Click Edit in the upper-right corner. In the Edit Rule Template dialog box, modify the parameters and click Confirm. |
|
Delete |
Click Delete in the upper-right corner. In the Delete Template dialog box, click Confirm. |
|
Copy |
Click Copy in the upper-right corner. In the Clone Rule Template dialog box, enter a Template Name, select a Location, and click Confirm. |
Apply a custom rule template
When you add a monitoring rule, you can use a custom rule template.
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Data Quality.
-
Configure monitoring rules for a specific table.
In the left-side navigation pane, choose to go to the Configure by Table page.
-
In the Connection list on the left, select the database where the target table resides.
-
Filter the tables by database type, database, or table name. Click the name of the target table or click Actions in the Rule Management column to open the table quality details page.
This page displays all configured quality monitoring schedules and rules for the current table. You can filter rules based on whether they are associated with a quality monitoring schedule and define how unassociated rules are run.
The page has two tabs: Rule Management and Quality Monitoring. On the Rule Management tab, you can click New Monitoring Rule to create a rule. For existing rules, you can Modify or Delete them, and view the Operation Log.
-
-
On the Table Quality Details page, go to the Rule Management tab, select a quality monitoring schedule and then click Create Rule. This action opens the rule configuration page.
-
Create a Data Quality rule from a custom rule template.
When you use a custom rule template, its configurations, such as the FLAG parameter parameters and the SQL, are automatically populated. You can customize the Rule Name and configure monitoring thresholds based on the rule type. For example, for a numeric rule, you need to define normal and critical thresholds. For a fluctuation rule, you also need to define a warning threshold.
Click the + Custom Rule Template tab. In the Custom Rule Template list on the left, find the target template and click + Use next to it. This action automatically populates the form on the right with the template's configurations. Modify the parameters as needed.
For descriptions of the parameters, see Create a custom rule template.
-
Click Confirm.
Related documents
You can use a custom rule template when using the Configure by Table feature. For more information, see Configure monitoring rules for a single table.