Foreign-Key Pair Match Rate

Measure the fraction of child key occurrences present in an exact parent-key set, counting repeated children individually and treating empty strings literally; no children returns hasChildren false and rate zero.

Description

A foreign-key match rate measures how many child values appear among supplied parent keys.

A foreign-key match rate measures how many child values appear among supplied parent keys. It is a coverage check, distinct from requiring the parent keys to be unique or the relationship to be complete.1

Measure the fraction of child key occurrences present in an exact parent-key set, counting repeated children individually and treating empty strings literally; no children returns hasChildren false and rate zero.

When to use Foreign-Key Pair Match Rate

Use this tool to measure the fraction of child key occurrences present in an exact parent-key set, counting repeated children individually and treating empty strings literally; no children returns hasChildren false and rate zero.

Choose the original CSV text, decoded cell strings, byte values or counts requested by this tool. Use the stated delimiter, encoding, indexing and number/date convention.

How to use Foreign-Key Pair Match Rate and understand its results

  1. Choose the original CSV text, decoded cell strings, byte values or counts requested by this tool. Use the stated delimiter, encoding, indexing and number/date convention.
  2. Enter parentKeys, childKeys using the field table and calculation rules, then run the tool.
  3. Read matchedCount, childCount, matchRate, hasChildren. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
parentKeysParent keyslist of string; maximum length: 10000; minimum entries: 0; maximum entries: 10000Required
childKeysChild keyslist of string; maximum length: 10000; minimum entries: 0; maximum entries: 10000Required

Enter the parent and child key lists as exact strings. Parent values are placed in a set, so repeated parents do not increase coverage. Every child occurrence is counted separately, including repeated matching child keys. Empty strings can match like any other key. With no children, the rate is 0 and hasChildren is false rather than indicating failed matches.

matchRate = matched child occurrences / child occurrences; empty child list → 0

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
matchedCountMatched countinteger; minimum: 0; maximum: 9007199254740991
childCountChild countinteger; minimum: 0; maximum: 9007199254740991
matchRateMatch ratenumber; minimum: 0; maximum: 1
hasChildrenHas childrenboolean
json
{
  "input": {
    "parentKeys": [
      "a",
      "b"
    ],
    "childKeys": [
      "a",
      "a",
      "c"
    ]
  },
  "output": {
    "matchedCount": 2,
    "childCount": 3,
    "matchRate": 0.6666666666666666,
    "hasChildren": true
  }
}

Limitations and assumptions

The tool does not normalize keys, enforce parent uniqueness, query a database or distinguish missing values from an empty-string key. A full rate concerns only the supplied samples and does not certify referential integrity for a larger dataset.

Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Cell-string lists also have a combined text budget of 100,000 UTF-16 units per list. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.

Alternative or Complementary methods

Use ID Column Uniqueness Check: Check exact string ID uniqueness in a supplied column, treating empty strings and leading zeros literally; report indices of occurrences after each first occurrence. For a complementary task, use Column Type Inference From Sample: Infer empty, integer, decimal, or string from a column sample using ASCII decimal token syntax; blanks are ignored and leading-zero identifiers remain strings.

References

  1. Foreign-Key Pair Match Rate — tool.io

Similar or alternative tools

  • ID Column Uniqueness Check

    Check exact string ID uniqueness in a supplied column, treating empty strings and leading zeros literally; report indices of occurrences after each first occurrence.

  • Column Type Inference From Sample

    Infer empty, integer, decimal, or string from a column sample using ASCII decimal token syntax; blanks are ignored and leading-zero identifiers remain strings.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies