Length Check Rule
Description
The Length Check Rule is a validation rule used to ensure that the length of a given input or data string falls within a specified range or exactly matches a required length.
Rule Configuration
The rule configuration success ensures that the input values adhere to the specified length requirements. It guarantees that the value meets or exceeds the minimum length, does not exceed the maximum length, and is exactly the required length when specified. This helps in maintaining consistency and validity in the input data.
- Minimum Length The shortest permissible length for a value or input string.
- Maximum Length The longest permissible length for a value or input string.
- Exact Length The input string must be exactly the specified length.
Success Criteria
The success criteria for a Length check rule in data quality are based on ensuring that data values meet predefined length requirements for each field configured using Minimum and Maximum length and Exact length. Additionally, the rule also includes the condition that if the value is an empty string and not null, it is treated as having a length of 0.
-
The success condition depends on how the
minimum length
,Maximum length
andExact length
is configured. -
The success condition is met if this count satisfies the given
operator
andvalue
. -
For example if the
Minimum Length
is set to3
andMaximum length
is set to 5 words likeabcd
will pass but words likeab
andabcdefghi
will not since they exceed maximum length,if `exact length is set the length of the word should exactly match with specified length.Configuration Fields
-
Operator Options
-
Greater than
-
Less than
-
Equal to
-
Between
(requires specifying a start and end range) -
Operator Defines the comparison operation (Greater Than, Less Than, Equal To, or Between).
-
Value The threshold value used for success criteria. Required for
Greater than
,Less than
, andEqual to
operators. -
Value Range Required only when the
Between
operator is selected, specifying thestart
andend
range. -
Threshold Type Indicates whether the
Value
orValue Range
to be considered as percentage or an absolute count. -
Allow Null Values Determines if null values are permitted.
-
-
Example Input
ID | Data | Number |
---|---|---|
1 | ”abc” | 45 |
2 | ”abcd” | 456784 |
3 | ”ab” | 6 |
4 | ”abcdefghi” | 4536 |
5 | ”abcd” | 897 |
Example Rule Configuration
- Minimum Length 3
- Maxiumum Length 5
- Exact Length Not Applicable When Minimum and Maximum are given.
- Left Trim True
- Right Trim True
- Consider White Spaces True
Example Success Criteria Configuration
- Operator Between
- Value Range
Start
= 3,End
= 5 - Threshold Type Absolute Count
- Allow Null Values False
Example Output
Column Name | Rule Name | Success Count | Failure Count | Within Threshold | Null Count |
---|---|---|---|---|---|
Data | Length Check | 3 | 2 | Yes | 0 |
Number | Length Check | 2 | 3 | No | 0 |