Rule Set Configuration > Rule Set Configuration Examples
  

Rule Set Configuration Examples

The number of rule sets that you configure in a rule specification depends on the facts that you need to determine about the input data.
You can configure rule sets in the following ways:

Rule Sets that Read a Single Data Input

Configure a rule set to read a single data input when you want to analyze a range of data values in an input column. Define rule statements that apply the same condition logic to the input, and define a different action for the outcome of each condition.

Single Input Example

An airline sells airplane tickets online. The airline sells tickets at different prices for travelers in different age groups. The airline defines a business rule that requires the customer database to identify the age group of each traveler. You configure a rule set with a single input that reads date-of-birth data from a customer data set. You create a series of rule statements that compare the data values in the input data to the current date.
You configure a rule set with the following rule statements:
1. IF AGE >= 65 THEN SENIOR
2. IF AGE >= 18 THEN ADULT
3. IF AGE < 18 THEN STUDENT
The rule set returns data from the first rule statement that can generate an action. Therefore, the order of the rule statements is relevant. If the rule set reads the second rule statement first, the rule set cannot identify any traveler in the senior age category. When the rule set reads the second rule statement first, the rule set identifies all traveler who are 18 years or older as adults.

Rule Sets with Dependent Conditions

Configure a rule set with rule statement conditions in a dependent relationship when the business rule requires multiple conditions to be true. Define a rule statement that applies a set of related conditions to the inputs, and define a single action for the conditions.
Use an AND operator in the rule statement to join the conditions.

Dependent Conditions Example

A city bus company wants to hire bus drivers. The bus company requires all drivers to pass an eyesight test and to hold a license to drive a bus. The company defines a business rule that requires the employee database to verify the eyesight test status and the license status for each driver. You configure a rule set with inputs that represent the status data for the eyesight test and the license. You configure a rule statement with a condition for each input.
You configure a rule set with the following rule statements:
1. IF EYESIGHT TEST IS YES
AND DRIVERS_LICENSE IS YES THEN VALID
2. IF EYESIGHT TEST IS NOT YES THEN NOT_VALID
3. IF DRIVERS_LICENSE IS NOT YES THEN NOT_VALID
The rule set returns data from the first rule statement that can generate an action. However, the order of the rule statements is not relevant in the example. If the data on any input is not valid, then the input row is not valid.

Rule Sets with Independent Conditions

Configure a rule set with rule statements in an independent relationship when the business rule requires one of multiple conditions to be true.

Independent Conditions Example

A bank wants to offer credit cards to customers. The bank decides that any customer with a credit balance greater than $5,000 or a salary greater than $50,000 is eligible for a credit card. The bank defines a business rule that requires the customer database to identify the eligible customers. You configure a rule set with inputs that represent the customer salary and the customer balance. You configure a rule statement to test each input.
You configure a rule set with the following rule statements:
1. IF CUSTOMER SALARY >= 50000 THEN OFFER_CARD
2. IF CUSTOMER BALANCE >= 5000 THEN OFFER_CARD
The rule set returns data from the first rule statement that can generate an action. However, the order of the rule statements is not relevant in the example. If the data on any input is valid, then the input row is valid.

Parent Rule Sets and Child Rule Sets

When a business rule describes a data requirement that depends on other data requirements, configure rule sets in a parent-and-child relationship.

Parent and Child Example

A hardware store sells wood preserver in multiple colors and styles. The store needs to verify that the product database can track the inventory of wood preserver in the warehouse. The store defines a business rule that requires the product database to maintains accurate data for the colors, styles, and units of wood preserver. You configure child rule sets to verify the data for each type of wood preserver. You connect a parent rule set to verify the output from the child rule sets.
You configure the following child rule sets:
Rule Set Name: Color
1. IF COLOR = PINE THEN VALID_COLOR
2. IF COLOR = OAK THEN VALID_COLOR
3. IF COLOR = CHESTNUT THEN VALID_COLOR
Rule Set Name: Size
1. IF SIZE = 16 OZ THEN VALID_SIZE
2. IF SIZE = 32 OZ THEN VALID_SIZE
3. IF SIZE = 500 ML THEN VALID_SIZE
Rule Set Name: Style
1. IF STYLE = GLOSS THEN VALID_STYLE
2. IF STYLE = MATT THEN VALID_STYLE
You configure the following parent rule set:
Rule Set Name: Wood Preserver
1. IF COLOR = VALID_COLOR
AND SIZE = VALID_SIZE
AND STYLE = VALID_STYLE THEN WOOD PRESERVER IS VALID_PRODUCT
You can configure similar parent and child rule sets for other products in the inventory.
Note: You might also create a reference table that contains a list of the valid colors or styles. You can then use the function options in the rule statement to compare the input values to each reference table. Create a reference table in the Analyst tool.