Examples of Loading Cross-Validation Rules With Operators
When creating cross-validation rules, the application uses OR operator if the same segment is used with different values in Condition or Validation filters. Further, the application uses AND operators for different segments in condition or validation filters.
Let's consider these examples with OR and AND operators.
If you define a condition filter for the company segment values, Operations and Production, then the application evaluates the rule as shown in this statement:
Company = Operations (OR) Company = Production
If you define a condition filter for Company = Operation and Business Unit = Albany, then the application evaluates the rule like this:
Company = Operations (AND) Business Unit = Albany
The supported operators are shown in this table:
Operator |
Description |
---|---|
STARTSWITH |
Starts with |
ENDSWITH |
Ends with |
= |
Equals |
<> |
Does not equal |
> |
Greater than |
<= |
Less than or equal to |
>= |
Greater than or equal to |
BETWEEN (Using '-' to separate two values) |
Between |
NOTBETWEEN |
Not Between |
CONTAINS |
Contains |
DOESNOTCONTAIN |
Does not contain |
ISBLANK |
Is blank |
ISNOTBLANK |
Is not blank |
Example 1: Location Depends Upon Activity
If the Activity Code is equal to 2200, then Location can't be either 2201 or 22EE.
The application evaluates this condition:
Activity Code = 2200
If the condition filter is satisfied, then the application applies this validation filter:
(Location NOTEQUAL 2201) or (Location NOTEQUAL 22EE)
This illustration shows how the application evaluates the condition filter and later applies the validation filter accordingly for the cross-validation rule.
Use this CostKffValidationRule.dat file to apply the condition and validation filters:
METADATA|CostKffValidationRule|StructureInstanceCode|RuleCode|RuleDescription|ErrorMessageText|EnabledFlag|StartDateActive|EndDateActive|ConditionFilterText|ValidationFilterText
MERGE|CostKffValidationRule|31|HDL_COST_CVR_COST_KFF_INST|ACTIVITY_LOCATION_RULE|Rule to Check Activity and Location|Activity and Rule not Satisfy Rule Check|Y|2010/01/01|4712/12/31|ACTIVITY_CODE = 2200|LOCATION <> 2201,LOCATION <> 22EE
In the above example, if the cost combination has Activity Code = 2200, then the process checks whether the Location is 2201 or 22EE. If the Location is one of these values, then the cost combination doesn't get created as it isn't a valid combination. Any value other than 2201 or 22EE for Location, is considered as valid for Activity Code = 2200 and the cost code combination is created.
Example 2: Activity Code Validation Based On Activity Code and Activity Code Charged
Let's assume that the Activity Code starts with 3 or the Activity Code Charged starts with 4. Then, the Activity Code must end with {0-7} for the company code =01.
Let's assume that the Activity Code starts with 3 or the Activity Code Charged starts with 4. Then, the Activity Code must end with {0-7} for the company code =01.
Then the application applies this validation rule:
Activity Code must end with {0-7} for the company code =01
This illustration shows how the application evaluates the condition filter and later applies the validation filter accordingly for the cross-validation rule.
Use this CostKffValidationRule.dat file to apply the condition and validation filters:
METADATA|CostKffValidationRule|CrossValidationRuleId|StructureInstanceCode|RuleCode|RuleDescription|ErrorMessageText|EnabledFlag|StartDateActive|EndDateActive|ConditionFilterText|ValidationFilterText
MERGE|CostKffValidationRule|32|HDL_COST_CVR_COST_KFF_INST|<RuleCode>|<ruleDesc>|<errorMsgTxt||Y|2010/01/01|4712/12/31|Company = 01,ACTIVITY_CODE STARTSWITH 3, ACTIVITY_CODE STARTSWITH 4|ACTIVITY_CODE ENDSWITH 0,ACTIVITY_CODE ENDSWITH 1,ACTIVITY_CODE ENDSWITH 2,ACTIVITY_CODE ENDSWITH 3,ACTIVITY_CODE ENDSWITH 4,ACTIVITY_CODE ENDSWITH 5,ACTIVITY_CODE ENDSWITH 6,ACTIVITY_CODE ENDSWITH 7
Example 3: Activity Code Based on Cost Center
If Cost Center is less than or equal to 100, then Activity Code must be 2000. The application evaluates the condition filter that the cost center is less than or equal to 100. If the condition filter is satisfied, then the application applies the validation filter that the activity code must be 2000.
This illustration shows how the application evaluates the condition filter and later applies the validation filter accordingly for the cross-validation rule:
Use this CostKffValidationRule.dat file to apply the condition and validation filters:
METADATA|CostKffValidationRule|StructureInstanceCode|RuleCode|RuleDescription|ErrorMessageText|EnabledFlag|StartDateActive|EndDateActive|ConditionFilterText|ValidationFilterText
MERGE|CostKffValidationRule|33|HDL_COST_CVR_COST_KFF_INST|ACTIVITY_CODE_CHECK_RULE|Check Activity Code|Activity Code must be 2000 for Cost Center less than 100.|Y|2010/01/01|4712/12/31|COST_CENTER <= 100|ACTIVITY_CODE = 2000
Example 4: Activity Code Range for a specific Cost Center
If Cost Center is 100, then Activity Code must be between 2000 and 4000. The application evaluates the condition filter that the cost center is 100 or not. If the condition filter is satisfied, then the application applies the validation filter that the activity code must be between 2000 and 4000.
This illustration shows how the application evaluates the condition filter and later applies the validation filter accordingly for the cross-validation rule:
Use this.dat file to apply the condition and validation filters:
METADATA|CostKffValidationRule|StructureInstanceId|StructureInstanceCode|RuleC
ode|RuleDescription|ErrorMessageText|EnabledFlag|StartDateActive|EndDateActive
|ConditionFilterText|ValidationFilterText
MERGE|CostKffValidationRule||HDL_COST_CVR_COST_KFF_INST|ACTIVITY_CODE_BETWEEN_
CHECK|Activity Code between validation for Cost Center|Activity Code must be
between 2000 and 4000 if Cost Center is 100|Y|2018/01/01||COST_CENTER =
100|ACTIVITY_CODE BETWEEN 2000-4000