Enum validation (allowed-values validation) is a data quality rule that checks whether a field value belongs to a predefined list of approved options — rejecting or flagging any value that doesn't match an approved entry.
It's the most direct fix for one of the most common data quality problems: categorical fields that have accumulated dozens of variations of the same underlying value.
Why Enum Validation Matters
"Active", "active", "ACTIVE", "Actve", and "1" might all mean the same status — but without enum validation, your system treats them as five different categories. A segment filter for "Active" misses every record coded as "active." Your segment appears smaller than it is.
Sohovi lets you set up validation rules for any column and instantly see which rows fall outside them — no code or SQL required.
Defining Your Approved Value List
| Field | Approved values | |---|---| | Customer status | Active, Inactive, Churned, Prospect, Lead | | Country code | ISO 3166-1 alpha-2 codes only | | Subscription tier | Free, Pro, Business | | Lead source | Organic, Paid Search, Referral, Direct, Event, Partner | | Priority | Low, Medium, High, Critical |
Applying Enum Validation to Existing Data
Phase 1: Audit. Run a distinct-value count on each categorical field. For every value not in your approved list, categorize it: typo (correct to approved value), synonym (map to approved value), or unknown (investigate).
Phase 2: Standardize. Apply the mappings to normalize all existing non-standard values.
Sohovi's profiling report shows the distinct value distribution for every categorical column — so you can see at a glance how many variants exist before normalizing.
Preventing New Enum Violations
- Dropdown menus in data entry forms instead of free-text fields
- CRM picklist enforcement that restricts field values
- Import validation rules that reject records with unapproved values
- Periodic audits to catch new variants that slipped through
Frequently Asked Questions
Q: What is enum validation in data quality? Enum validation checks whether a field value belongs to a predefined list of approved options. Any value not on the list is flagged or rejected. It's the standard approach for enforcing consistency in categorical fields like status, type, region, and category.
Q: What's the difference between enum validation and format validation? Format validation checks structural form. Enum validation checks semantic content — is this value one of the permitted options? They operate independently.
Q: How do I handle case sensitivity in enum validation? Best practice is to normalize to a single case before validation. Avoid having both "Active" and "active" in your approved list — choose one canonical form and enforce it consistently.
Q: What should I do with values that aren't in the approved list? Categorize them: obvious typos can be auto-corrected, synonyms should be mapped to a canonical form, and unknown values should be routed for human review.
Q: Can enum validation handle dynamic allowed-value lists? Yes. If your approved list grows over time, your validation rule should reference the current list dynamically rather than a hardcoded set.
Q: What is the impact of enum violations on segmentation and reporting? Enum violations fragment your categorical groups. A status field with "Active", "active", and "ACTIVE" splits your active customers across three groups — any filter that uses a single value misses the other two.
Q: How many approved values should a categorical field have? The right number is determined by your business needs. The goal is the minimum number of distinct values that captures meaningful distinctions for your analytics, while eliminating redundant variants.
Q: Should historical records with old values be updated to the new enum list? For reporting and analytics, normalizing historical data to the current enum list produces consistent trend comparisons. For audit trails and compliance records, preserving original values may be required.
Q: How do I detect enum violations in a large dataset efficiently? A distinct-value count per categorical column. Instead of reviewing every record, you review the list of all distinct values and immediately see which ones fall outside your approved list.
Q: What's the relationship between enum validation and data standardization? Enum validation checks that values are in the approved list. Data standardization converts non-standard values to their canonical form. Validation identifies the problem; standardization fixes it.
Enum validation is the fastest fix for fragmented categorical data. Define your approved lists, apply them to existing data, and enforce them at entry — your segmentation and reporting will immediately become more reliable.
