# Contains Social Security Number Best Practices

Source: https://userguide.qualytics.io/data-quality-checks/contains-social-security-number/deep-dive/best-practices/

Guidelines for getting reliable signal from Contains Social Security Number checks while keeping the noise (and the maintenance) low.

## Point the check at a field that should always carry the value

The rule asserts that social security numbers are present in every row, so it belongs on a column dedicated to that data. Pointing it at a free-text column where a social security number is merely common turns every ordinary row into an anomaly.

## Use containment deliberately

The value passes as soon as a social security number appears anywhere inside it, so `"contact: {value}"` passes just like a bare value. When the field must hold nothing but the value, pair the check with [Matches Pattern](https://userguide.qualytics.io/data-quality-checks/matches-pattern/introduction/) anchored to the whole string.

## Pair with Not Null when the field is mandatory

NULL values pass. Contains Social Security Number asserts that *present* values contain a social security number; it does not require the field to be populated. When the field must also exist, add a [Not Null](https://userguide.qualytics.io/data-quality-checks/not-null/introduction/) check on the same field.

## Scope the check to the population the format applies to

The format is national. Running the check on a table that also holds international records reports every foreign identifier as a violation. Use a filter on the country or the record type so only the relevant population is evaluated.

## Consider whether the column should hold this data at all

A column that fails this check may be telling you something useful: the identifier is stored somewhere it should not be, or it should be masked. Review the field's masking configuration alongside the anomaly.

## Keep coverage at 100% unless a known backlog exists

At 100% coverage every failing row is reported as a Record Anomaly, which tells you exactly which values are wrong. Below 100% the check reports a single Shape Anomaly only when the failing fraction crosses the tolerance, and no per-row detail is produced. Lower coverage only while a known set of legacy rows is being cleaned up.

## Scope with a filter instead of loosening coverage

When the rule only applies to part of the table (one channel, one country, rows created after a migration), express that with a filter clause rather than by lowering coverage. The filter removes the out-of-scope rows from evaluation entirely, and the expression is echoed in every anomaly message.

## Route the anomalies to the right people

A missing or malformed value usually comes from a collection form or an integration. Set an **Anomaly Assignee** from the team that owns that producer, and tag the check so related checks are easy to find.

## See Also

- **How It Works**

  The complete reference: definition, field scope, pattern matching, NULL handling, arrays, filter behavior, and coverage.

  [How It Works](https://userguide.qualytics.io/data-quality-checks/contains-social-security-number/deep-dive/how-it-works/)
- **Anomaly Reporting**

  The anomaly messages the check produces, what the numbers mean, Source Records highlighting, and Custom Anomaly Description.

  [Anomaly Reporting](https://userguide.qualytics.io/data-quality-checks/contains-social-security-number/deep-dive/anomaly-reporting/)
- **Examples**

  Three production scenarios with sample data, anomaly messages, and the SQL equivalent of what the check evaluates.

  [Examples](https://userguide.qualytics.io/data-quality-checks/contains-social-security-number/deep-dive/examples/)
- **Permissions**

  The team permission each action needs: view, create, edit, archive, restore, and delete.

  [Permissions](https://userguide.qualytics.io/data-quality-checks/contains-social-security-number/deep-dive/permissions/)

*Last updated: September 21, 2026.*
