Skip to content

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 and Exact length is configured.

  • The success condition is met if this count satisfies the given operator and value.

  • For example if the Minimum Length is set to 3 and Maximum length is set to 5 words like abcd will pass but words like ab and abcdefghi 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, and Equal to operators.

      • Value Range Required only when the Between operator is selected, specifying the start and end range.

      • Threshold Type Indicates whether the Value or Value Range to be considered as percentage or an absolute count.

      • Allow Null Values Determines if null values are permitted.

Example Input

IDDataNumber
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

alt text alt text

Example Output

Column NameRule NameSuccess CountFailure CountWithin ThresholdNull Count
DataLength Check32Yes0
NumberLength Check23No0