Data and AI Training

Home | Power BI | Excel | Python | SQL | Generative AI | Visualising Data | Analysing Data

Data Quality Discussion

We may receive a large dataset, possibly in an Excel spreadsheet. The dataset often has many columns. Here are some suggestions about how to improve data quality in two stages: inspect the data and make a plan , then clean the data.

Inspect the data

Firstly inspect the data, and ask the question - is this reasonable? Here is a brief checklist

There is a detailed discussion of these at the bottom of the page.

Clean the data

When cleaning data, always ensure that you or someone else, can repeat or reproduce the series of steps. You must, for example:

This is in the spirit of the NHS’s Reproducible Analytical Pipelines (RAP) strategy.

Essential: Firstly, format the data as an Excel table.

Here are some suggested approaches

We may need to split the table into two (or more) if it is an “everything and the kitchen sink” table with many columns that have duplicated values. For example, one table containing patient details and also list of appointments needs to be split into two tables, patient and appointment, related by the unique patient identifier.

Footnote: Inspect the data - more details

Here are more details about the checklist points

Is the data really tabular?

  1. Are the data in the rows consistent from row to row?
  2. If there are any calculated columns, is the same calculation used for every row?
  3. Does every cell have one and only one value?
  4. Are there any ‘junk’ rows i.e. rows that do not represent an item of data e.g. subtotals, extra headers, comment lines, footers?
  5. Is it two different types of data crammed into one table

Look at the data column by column and ask these questions:

Are there any error cells? i.e. cells with #NA! or other errors?

Are there any missing values? If so:

Is the data really tidy? Or is the same variable spread across several columns?

Are there any suspicious values, for example:

Is the data denormalised - can we split it into a fact table with fewer columns and one or more dimension tables?