Skip to content

How each quality dimension is measured

How quality is measured says which quality dimensionsDimension The kind of quality a rule measures (completeness, validity, timeliness…), given by its pattern. Quality Data uses and which rulesRule It applies a pattern to a field; the pattern gives it its dimension and a default severity. The rules that count are the ones on main, the approved version. belong to each. This page gives the formula of each dimension, so that a figure can be checked by hand.

Every dimension yields a value between 0 and 1, shown as a percentage. For every dimension but completenessCompleteness Quality dimension: the data is present when it must be., the higher, the better; completeness counts what is missing, so for it the lower, the better. Each value is measured per variable (one field of a datasetDataset One table of a source as Quality Data reads it: a name, its fields and the rules that check them., such as a document number or an income) and per cut, so the same variable can be followed from one cutCut The dataset's data as it was on one date, copied into the lake so it can be measured again without touching the source. Every figure of a report refers to that moment. to the next.

Notation: ii = variable, jj = record, NiN_i = total records of variable ii in the cut. Unless a dimension says otherwise, NiN_i counts all records, including those where the value is not filled in: an empty value is not left out, it counts against the dimension.

How much of the variable is not filled in.

Completenessi=empty or null recordsiNi\text{Completeness}_i = \frac{\text{empty or null records}_i}{N_i}

This measure is the share of empty or null records: the lower, the better, unlike the other dimensionsDimension The kind of quality a rule measures (completeness, validity, timeliness…), given by its pattern., where higher is better. 0 means no record is missing the value.

Completeness of a fieldExample dataTen records of the e-mail field: the measure is the share of empty ones (the lower, the better).
  • Filled in
  • Empty or null
Ten records of an e-mail field; two are empty. Completeness: 2/10 = 20%.Record 1a@x.coRecord 2b@y.coRecord 3(empty)Record 4c@z.coRecord 5d@x.coRecord 6(empty)Record 7e@y.coRecord 8f@z.coRecord 9g@x.coRecord 10h@y.co2/10 = 20%
Show the data as a table
RecordE-mail
1a@x.co
2b@y.co
3(empty)
4c@z.co
5d@x.co
6(empty)
7e@y.co
8f@z.co
9g@x.co
10h@y.co

Whether the value has the right form for its kind of field. Each kind has its own check, measured over all values, including those not filled in:

Kind of field Formula
Document 1−records with spacesN1 - \dfrac{\text{records with spaces}}{N}
Name 1−records with special charactersN1 - \dfrac{\text{records with special characters}}{N}
Phone 1−records without exactly 10 digitsN1 - \dfrac{\text{records without exactly 10 digits}}{N}
E-mail records with the structure text@text.textN\dfrac{\text{records with the structure text@text.text}}{N}
Date records within the valid date rangeN\dfrac{\text{records within the valid date range}}{N}
Financial variable numeric recordsiNi\dfrac{\text{numeric records}_i}{N_i}

The first three count what is wrong and subtract it from 1; the last three count what is right (a phone counts as valid only with exactly 10 numeric digits, nothing else). Both read the same way: 1 means every value is valid. An empty value is not a valid e-mail, date or number, so it lowers those three.

Validity by kind of fieldExample dataA document with a space, a name with a special character, a phone without 10 digits, an e-mail without @, a date out of range and a non-numeric amount are not valid; nor is an empty value.
  • Valid
  • Not valid
Five sample values per kind of field, marked valid or not, with each kind's valid share.Document102030401020 304155678899998877661234567880%NameAna RuizLuis#GilEva PazJuan SolRosa M@r60%Phone30012345673001233109876543(empty)311555000060%E-mailana@x.coluis.x.coeva@y.org(empty)rosa@z.co60%Date2024-03-011890-01-012023-11-202031-05-052022-07-1560%Amount1200000N/A350000980004500080%
Show the data as a table
Kind12345Valid
Document10203040 ✓1020 3041 ✗55678899 ✓99887766 ✓12345678 ✓80%
NameAna Ruiz ✓Luis#Gil ✗Eva Paz ✓Juan Sol ✓Rosa M@r ✗60%
Phone3001234567 ✓300123 ✗3109876543 ✓(empty) ✗3115550000 ✓60%
E-mailana@x.co ✓luis.x.co ✗eva@y.org ✓(empty) ✗rosa@z.co ✓60%
Date2024-03-01 ✓1890-01-01 ✗2023-11-20 ✓2031-05-05 ✗2022-07-15 ✓60%
Amount1200000 ✓N/A ✗350000 ✓98000 ✓45000 ✓80%

Whether a value that must identify one record appears only once.

Uniquenessi=1−duplicate recordsiNi\text{Uniqueness}_i = 1 - \frac{\text{duplicate records}_i}{N_i}

Measured over all values, including those not filled in.

Uniqueness of an identifierExample dataHere each repetition after the first appearance counts as a duplicate.
  • Unique
  • First appearance
  • Duplicate
Ten document numbers; 1002 appears three times and 1003 twice. Three records repeat a value already seen. Uniqueness: 1 − 3/10 = 70%.Record 11001Record 21002Record 31003Record 41002Record 51004Record 61005Record 71003Record 81006Record 91002Record 1010071 − 3/10 = 70%
Show the data as a table
RecordDocument
11001
21002
31003
41002duplicate
51004
61005
71003duplicate
81006
91002duplicate
101007

Whether a financial value is believable. Income and expenses each join two checks, with equal weight: the value is not zero, and income is not below expenses. Measured over all values, including those not filled in.

Accuracyincome=(1−ZincomeN)+(1−MN)2\text{Accuracy}_{\text{income}} = \frac{\left(1 - \dfrac{Z_{\text{income}}}{N}\right) + \left(1 - \dfrac{M}{N}\right)}{2} Accuracyexpenses=(1−ZexpensesN)+(1−MN)2\text{Accuracy}_{\text{expenses}} = \frac{\left(1 - \dfrac{Z_{\text{expenses}}}{N}\right) + \left(1 - \dfrac{M}{N}\right)}{2}

where:

  • ZincomeZ_{\text{income}} = records with income equal to zero;
  • ZexpensesZ_{\text{expenses}} = records with expenses equal to zero;
  • MM = records with income below expenses.

The second check is the same for both: a record whose income is below its expenses lowers the accuracy of both variables.

Accuracy of income and expensesExample dataTen records (in thousands): each check gives one half, and the two are averaged.
  • Fails the check
Ten records with income and expenses. Two have zero income and four have income below expenses; none has zero expenses. Income accuracy: ((1 − 2/10) + (1 − 4/10)) / 2 = 70%. Expenses accuracy: ((1 − 0/10) + (1 − 4/10)) / 2 = 80%.12345678910Income1200958015060020070110Expenses8040100509075301204060Income = 0·✗····✗···Income < expenses·✗✗··✗✗···Income accuracy: ((1 − 2/10) + (1 − 4/10)) / 2 = 70%Expenses accuracy: ((1 − 0/10) + (1 − 4/10)) / 2 = 80%
Show the data as a table
RecordIncomeExpensesIncome = 0Income < expenses
112080
2040✗✗
395100✗
48050
515090
66075✗
7030✗✗
8200120
97040
1011060

Whether the same financial variable agrees between two sets that must hold the same values: set AA and set BB, such as two sourcesSource A database the organisation already runs. Quality Data reads it and never writes to it., or a detail and its total.

Consistencyi=1−∣∑Ai−∑Bi∣∑Ai\text{Consistency}_i = 1 - \frac{\left|\sum A_i - \sum B_i\right|}{\sum A_i}

where ∑Ai\sum A_i and ∑Bi\sum B_i are the sums of the values of variable ii in set AA and in set BB.

Set AA is the reference: the difference is read as a share of its total, so its sum must not be zero. Measured over all values, including those not filled in.

Consistency between two setsExample dataThe same variable summed in two sets that must agree; the gap is read against A's total.
  • Sum of the set
  • Gap
A variable sums 1,000 in set A and 940 in set B. Consistency: 1 − |1,000 − 940| / 1,000 = 94%.Σ set A1,000Σ set B940|A − B| = 601 − |1,000 − 940| / 1,000 = 94%
Show the data as a table
SetSum
A1,000
B940
|A − B|60

Whether a value has been updated recently enough for the risk it carries.

Timelinessi=1−records with dj>Dj+30Ni\text{Timeliness}_i = 1 - \frac{\text{records with } d_j > D_j + 30}{N_i}

where:

  • djd_j = calculation date − date the field was last updated, in days;
  • DjD_j = maximum number of days allowed by the record’s risk profile.

A record is late when its value is older than its risk profile allows, plus 30 days of grace. When the sourceSource A database the organisation already runs. Quality Data reads it and never writes to it. keeps only a general last-update date per person, not one per field, that date is used for every field measured. Measured over all values, including those not filled in.

Timeliness by risk profileExample dataEach bar is d, the days from the last update to the calculation date. Dashed line: D, the profile's maximum (high 180, low 365); solid line: D + 30.
  • On time
  • Late
  • D
  • D + 30
Five records with the days since their last update against their risk profile's maximum plus 30 days. Two exceed it. Timeliness: 1 − 2/5 = 60%.Record 1 · risk highRecord 2 · risk low✗Record 3 · risk high✗Record 4 · risk lowRecord 5 · risk high090180270360450days (d)1 − 2/5 = 60%
Show the data as a table
RecordRiskDD + 30d
1high180210120
2low365395410late
3high180210230late
4low365395300
5high180210205

These formulas measure a dimension over a whole variable. In Quality Data, the rules of a datasetDataset One table of a source as Quality Data reads it: a name, its fields and the rules that check them. are what count each case: an empty value, a value with spaces, a duplicate, an old update. Which rules feed each dimension, and with which parameters (the valid date range, the risk profiles and their days), is configured per dataset. See Write, change and test a rule to configure them, Rule patterns for each patternPattern A reusable way of validating (required, format, fresh and eleven more). Each rule is a pattern applied to a field with its condition.’s dimension, and Formulas for the dashboardDashboard Each dataset's charts of the results of the cut chosen: conformity and IGCD by cut, failures by dimension and more.’s own figures.

Government Data · Guide v0.8.1