Your data may contain issues that are not immediately evident. For example, you may define a rule specification to find null values in a data column. However, the rule specification does not find values that contain character spaces exclusively. Such values can appear to be null when you view them onscreen.
To find the values, you define a rule specification with a series of rule statements. One rule statement searches for null values. Two additional rule statements search for fields that contain character spaces exclusively. To find the fields that contain character spaces only, you configure one of the rule statements to read the output from the condition of the rule statement that precedes it.
Finding null values
In this task, you define a rule statement that searches for null or empty strings. To find fields that contain null or empty strings, set the condition type to null value and use the is operator to determine if the input value is null.
1Select a rule set in a rule specification.
2In the rule set properties, click Rule Logic.
3Click Add Rule Statement.
4Select an input of type string for the rule statement.
- If the rule specification does not contain an input that you can use, create an input. Configure the input properties to represent the type of column that contains the business data.
5Select an operator to validate the results of the condition analysis.
- To specify that the input data must match the data in the condition, select the following operator:
is
6Select the type of condition to apply to the input.
- To verify that the input values are null, select the following condition type:
null value
7Select the type of action to apply to the data that satisfies the condition logic.
- To return an integer value, select the following action type:
integer value
8Enter the value that the action returns. For example, enter 2.
Note: Enter a value other than 1 or 0. The values 1 and 0 represent the true and false outcomes from the function that identifies character spaces in the next task.
Finding values that contain character spaces only
In this task, you define rule statements that search for fields that exclusively contain character spaces. You configure two rule statements, where one rule statement reads the result of another rule statement. To find fields that contain character spaces only, you create a rule statement that uses the Is Spaces function.
1Click Add Rule Statement.
2Select the input that you added in the earlier task.
3Select an operator to validate the results of the condition analysis.
- To specify that the condition does not apply to null data, select the following operator:
is not
4Select the type of condition to apply to the input.
- To identify input values that are not null, select the following condition type:
null value
5Select the type of action to apply to the data that satisfies the condition logic.
- To return an integer value, select the following action type:
integer value
6Enter the value that the action returns. For example, enter 3.
Note: Enter a value other than 1 or 0 and other than the value that you specified in the earlier task.
7Select Add Rule Statement Using Result from the actions menu on the current rule statement.
The rule specification adds an empty rule statement under the current rule statement. The rule statement reads the result of the rule statement above it.
8In the rule statement that you added in step 7, select an operator to validate the results of the condition analysis.
- To specify that the condition reads the output from the earlier rule statement, select the following operator:
is
9 Select the type of condition to apply to the input.
- To verify the output from the earlier rule statement, select the following condition type:
integer value
10Enter the value that you added in step 6 in the current task.
You configure the condition to search for values that indicate that the input string is not null. For example, enter 3 if the earlier rule statement returns the value 3 when an input string is not null.
11Select the type of action to apply to the data that satisfies the condition logic.
- To use a function expression in an action, select the following action type:
function
12Configure the action to search the input data for character spaces only.
- Open the Define Condition dialog box.
- Select Functions, and select Is Spaces.
- Select the string input that you specified in the earlier rule statements.
- Click OK.
13Save the rule specification.
The rule specification searches first for null strings and then for strings that contain character spaces only. The Is Spaces function returns 1 for any string that exclusively contains character spaces and 0 for any other string that it reads.