When you create a business rule, consider the context of the compliance tests you want to create, how they will be used, and the elements available to create the expression. Some questions to answer before you begin include:
When you create a business rule, consider the context of the compliance tests you want to create, how they will be used, and the elements available to create the expression. Some questions to answer before you begin include:
- Do you want to apply the standard against an attribute or an entity.
- Will the business rules be used for profiling (Discover) or standardizing (Develop) activities? For example, a profiling rule will determine pass or fail for standard. A standardizing rule applied to a Transformer conditional expression can be used to split the output based on passing and failing rows.
- If creating an attribute business rule, do you want to the passing threshold to represent a row or value count?
Example rule scenario
Your business compliance standard states that when FIRST and LAST values are combined they should equal the value in FULL. To check this compliance, you would write a business rule to be run against all rows within an entity.
The following example details how to build an entity business rule that tests that the combination of two attributes (X, Y) equals the value of a third attribute (Z). For this example case, we will concatenate first and last name attributes and test the result against a third attribute which is the full name. The results of the test will show which rows in the entity passed the test and which rows failed.
- From the Navigation View, right-click the entity to which you want to add the
rule and selection Business rules > Add entity business rule or (for
input entities in a Quality project) Tools > Business rules > Add entity business
rule
The Entity Business Rule window opens.
- In Name, type the name of the business rule; for example, "
F
IRST + LAST = FULL NAME
". - In Description, type a description of the rule and what it does; for
example, "
Check that FULL NAME = combination of FIRST and LAST.
" Click the button to open a text window to better work with long descriptions. - In Passing threshold, enter the percentage of rows that you want to comply with this business rule. In this case, enter 100% because we need all rows to comply.
- In the Business Rule section, to the right of the Expression field, click the
button.
The Rule Expression field displays along with the expression elements available to build the rule.
- Under Choose expression elements from the lists below, in the left pane, click Functions.
- In the middle pane, click String.
- In the right pane, select the function by double-clicking CONCAT.
The expression CONCAT(,) displays in the expression field.
- In the expression field, place your cursor before the comma (,).
- In the left pane click
Attributes.
The right pane populates with all available attributes in the current entity.
- In the right pane double-click First.
The attribute named First is inserted into the expression:
- In the expression field, place your cursor after the comma.
- In the left pane click Attributes and then double-click Last.
The attribute named Last is inserted into the expression:
- In the expression field, place the cursor after the last parenthesis and enter
the equals sign (=). Alternately, you can click the = icon or select
Operators > Comparison> =.
Your expression should now look like:
- In the expression field, place the cursor after the = and select Full from the attributes in the right pane. Your expression should now look like:
- Click OK to save the expression, then click Finish to save the business rule.
To analyze the rule and view how many rows of data passed and failed the rule. After a rule is created you run the rule against the values in the entity by analyzing the rule. Then you drill down from the rule to view the failing rows.