Aller au contenu
Londres, Royaume-Uni · Fondé en 1994
Français

Unit 2: Data Preparation and Quality

Where business data comes from and how it is structured, how to assess data quality, and the essential steps for cleaning and preparing data before analysis.

Unit 2 of 5 · about 54 minutes

2.1 Data sources and structures

Before you can analyse data, you need to know where it comes from, what it represents and how it is organised. Many analysis errors arise not from faulty calculations but from misunderstanding the data itself. This lesson introduces the main sources and structures of business data and the vocabulary used to describe them.

Common sources of business data

  • Transactional systems, such as sales, ordering, finance and payroll systems, record individual business events.
  • Customer relationship management (CRM) systems hold information about customers, contacts, enquiries and sales opportunities.
  • Operational systems, such as warehouse, scheduling and production systems, record activities and timings.
  • Digital channels, such as websites, apps and email platforms, record visits, clicks and interactions.
  • Surveys and feedback capture opinions and satisfaction.
  • Sensors and connected devices record measurements such as temperature, location or machine performance.
  • External data, such as official statistics, market research and weather data, provides context.

Each source was designed for a purpose, usually to run a process rather than to support analysis. This shapes what is recorded, how accurately and with what definitions. A field that matters little to the process, such as a customer's industry in a sales system, is often incomplete.

Structured and unstructured data

Structured data is organised in a fixed format, typically tables with rows and columns, such as a list of orders with date, customer, product and value. Most business analysis uses structured data. Unstructured data includes free text, emails, documents, images, audio and video. It can be valuable, for example complaint text that explains why customers are unhappy, but it needs additional processing to analyse. Semi-structured data, such as data exchanged between web systems, has some organisation but not a rigid table format.

Understanding tables

In a well-structured table, each row represents one record, such as one order, and each column represents one attribute, or field, such as order date. Several concepts are essential:

  • Granularity, or grain, is what one row represents. An orders table might have one row per order, while an order lines table has one row per product within each order. Confusing the two leads to double-counting.
  • Keys are fields that identify records. A primary key, such as an order number, uniquely identifies each row. A foreign key, such as a customer number in the orders table, links to another table.
  • Data types describe what a field contains, such as numbers, text, dates or true/false values. A date stored as text cannot be sorted or used in calculations correctly.

Types of variable

Variables can be categorical, describing groups such as region or product type, or numerical, describing quantities such as price or age. Categorical variables may be nominal, with no order (colours, departments), or ordinal, with a natural order (satisfaction ratings from "very poor" to "very good"). Numerical variables may be discrete, counted in whole numbers (number of complaints), or continuous, measured on a scale (delivery time). The type of variable determines which summaries and charts make sense: an average of department codes, for instance, is meaningless.

Remember: Before analysing any table, be able to say in one sentence what a single row represents. If you cannot, you are not yet ready to calculate totals or averages.

Data warehouses and data lakes

Larger organisations often bring data from many systems into a central store for analysis. A data warehouse holds cleaned, structured data organised for reporting, with agreed definitions. A data lake stores large volumes of raw data in many formats, which offers flexibility but requires more work to make the data usable. Many organisations use a combination.

Metadata and data dictionaries

Metadata is data about data: what each field means, where it comes from, how often it is updated and who is responsible for it. A data dictionary records this information for a dataset. Where one exists, read it before starting; where one does not, creating a simple version for the fields you use is a valuable contribution.

In practice

When you receive a new dataset, spend a few minutes exploring before analysing. Identify what one row represents, list the key fields and their data types, count the rows, check the date range covered and note which fields appear incomplete. Ask the system owner how the data is collected and whether any definitions have changed over time. These quick checks prevent many of the most common and embarrassing analysis errors, such as double-counting or comparing incompatible periods.

2.2 Assessing data quality

Analysis is only as reliable as the data behind it. Poor-quality data leads to wrong conclusions, wasted effort and lost trust in reporting. Assessing data quality systematically is therefore an essential early step in any analysis, not an optional extra.

Dimensions of data quality

Data quality is commonly described in several dimensions. Different organisations use slightly different lists, but the following are widely recognised.

DimensionQuestion it asksExample of a problem
AccuracyDoes the data correctly describe reality?A customer's address is out of date.
CompletenessIs all the required data present?Forty per cent of records have no industry code.
ConsistencyDoes the data agree across records and systems?A customer is "active" in one system and "closed" in another.
ValidityDoes the data follow the expected format and rules?A date of birth in the future, or a negative quantity.
UniquenessIs each real-world item recorded only once?The same supplier appears three times with different spellings.
TimelinessIs the data up to date enough for its purpose?Stock levels are refreshed weekly but needed daily.

How quality problems arise

  • Manual entry: typing errors, inconsistent spellings and fields left blank.
  • System design: free-text fields where a drop-down list was needed, or no validation rules.
  • Integration: different systems using different codes or definitions for the same thing.
  • Process change: definitions or procedures changing over time without the history being updated.
  • Incentives: staff under time pressure selecting default options or entering placeholder values.

Practical quality checks

Simple checks catch most problems:

  1. Count records and compare with an independent figure, such as the number of invoices in the finance system.
  2. Check totals against trusted reports, such as monthly revenue in the published management accounts.
  3. Look at the range of each numerical field: minimum, maximum and average. Values such as an age of 150 or an order value of zero stand out.
  4. Count blanks in each field to measure completeness.
  5. List the distinct values of categorical fields to spot inconsistent spellings or codes.
  6. Check for duplicates using key fields.
  7. Plot data over time to spot sudden jumps or gaps, which often signal a system or definition change rather than a real business event.

Tip: Reconcile your data to a trusted total before you start detailed analysis. If your sales dataset does not add up to the revenue figure in the management accounts, find out why first.

Fitness for purpose

Data does not need to be perfect; it needs to be good enough for the decision at hand. A marketing analysis of broad customer trends can tolerate a few missing postcodes, whereas payroll or regulatory reporting requires very high accuracy. Judge quality against the purpose, and be explicit about any limitations in your findings. Stating "industry was missing for 15 per cent of customers, so the industry breakdown should be treated as indicative" builds trust rather than undermining it.

It is also worth asking whether quality problems are random or systematic. A few typing errors spread evenly across records may barely affect an average. Missing data concentrated in one branch, one product line or one period, however, can produce a misleading picture, because the remaining records no longer represent the whole.

Fixing problems at source

Cleaning data repeatedly in each analysis treats the symptoms rather than the cause. Where problems recur, work with system owners to fix them at source: add validation rules, replace free text with drop-down lists, clarify definitions and give staff feedback on why accurate data matters. Many organisations appoint data owners or data stewards who are responsible for the quality of particular datasets, as part of a wider data governance framework.

In practice

Create a short data quality checklist based on the seven checks above and apply it to the next dataset you use. Record the results in a few lines: number of records, reconciliation to a trusted total, completeness of key fields, duplicates found and any obvious errors. Share significant issues with the data owner. Over time, these notes become a valuable record of known issues, saving you and your colleagues from rediscovering the same problems each time the data is used.

2.3 Cleaning and preparing data for analysis

Once you understand a dataset and its quality, the next step is to prepare it for analysis. Data preparation often takes more time than the analysis itself, but careful preparation is what makes the final results trustworthy. This lesson covers the main tasks and how to carry them out safely.

Golden rules

  • Never alter the original data. Keep a raw copy and work on a separate version.
  • Record every step, so that the process can be checked and repeated.
  • Make changes systematically, using rules or formulas rather than editing individual cells by hand where possible.
  • Check the effect of each step, for example by comparing record counts before and after.

Common cleaning tasks

  1. Removing duplicates. Identify records that represent the same real item. Exact duplicates are easy to find; near-duplicates, such as "Smith Ltd" and "Smith Limited", need matching rules and judgement.
  2. Standardising values. Make categories consistent, for example converting "UK", "U.K." and "United Kingdom" to one form, and using one format for dates and units.
  3. Correcting data types. Convert numbers stored as text into numbers and text dates into true dates, so that they sort and calculate correctly.
  4. Handling missing values. Options include leaving them blank and reporting the gap, excluding incomplete records from particular calculations, filling them from another reliable source, or, with care, estimating them. The right choice depends on why values are missing. If data is missing for a particular group, such as one region's records, excluding it may bias the results.
  5. Dealing with outliers. Extreme values may be errors, such as an extra zero, or genuine but unusual events, such as a single very large order. Investigate before deciding. Do not remove genuine values simply because they are inconvenient; instead, consider reporting results with and without them, or using measures such as the median that are less affected.
  6. Filtering. Remove records outside the scope of the question, such as test transactions, internal orders or periods not being analysed, and document the filters applied.

Combining data

Analysis often requires combining data from several sources, for example adding customer details to a list of orders. This is done by joining or looking up records using a common key, such as customer number. Joins are a frequent source of errors:

  • If the key is not unique in the table being joined, records may be duplicated and totals inflated.
  • If some keys have no match, records may be silently dropped or left with blanks.
  • If keys are formatted differently, for example with leading zeros in one system but not another, matches will fail.

Always compare record counts and totals before and after a join.

Remember: If a total changes after you combine or clean data, you must be able to explain exactly why. An unexplained change is a warning that something has gone wrong.

Shaping data for analysis

Analysis tools generally work best with tidy data: each variable in its own column, each observation in its own row and one type of observation per table. Spreadsheets designed for human reading, with merged cells, subtotals and months spread across columns, often need reshaping first. Analysts also create derived fields, such as order month from order date, profit from revenue and cost, or customer age band from date of birth, to make analysis easier.

Personal data and privacy

Data preparation is a good moment to apply data protection principles. Use only the personal data you need for the question, remove or mask direct identifiers such as names and email addresses when they are not required, store files securely and follow your organisation's data retention rules. Under laws such as the GDPR, using personal data for a new purpose may require additional consideration, so check with your data protection lead if in doubt.

In practice

Before your next analysis, write a short preparation plan listing the cleaning steps you expect to need. As you work, record each step, the number of records affected and the totals before and after. When you present results, include a brief note on the main preparation decisions, such as exclusions and how missing values were treated. This transparency allows others to understand and trust your findings, and it makes the analysis much quicker to repeat next time.

Case study: The case of the inflated revenue

An analyst at Marlow Outdoor, a fictional retailer of camping equipment, was asked to show revenue by customer type for the board. Her first result showed total revenue about 18 per cent higher than the figure in the management accounts.

Following her checklist, she compared record counts before and after each step. The difference appeared when she joined the orders table to the customer table. Some customers had been entered twice in the customer system, once by the online team and once by the trade sales team, so their orders were duplicated in the join.

She removed the duplicate customer records using agreed matching rules, after which revenue reconciled to the management accounts within a small, explained difference caused by returns processed after the month end. She also found that customer type was blank for 9 per cent of records, so she reported those separately rather than guessing. Finally, she raised the duplicate customer problem with the CRM owner, who introduced a check that warned staff when a new customer appeared to match an existing one.

Activity

Imagine you have received a spreadsheet of 5,000 customer orders for the past year, to be used to analyse average order value by region. List the quality checks you would carry out before analysis and the cleaning steps you might need. Explain how you would handle orders with no region recorded and one order that is fifty times larger than average.

Compare with a model answer

A good answer begins with checks: confirming what one row represents, counting records, reconciling total value to a trusted sales figure, checking the date range, counting blanks in key fields, listing distinct region names to spot inconsistent spellings, checking for duplicate order numbers and reviewing the minimum and maximum order values.

Cleaning steps might include standardising region names, converting text values to numbers, removing test or cancelled orders and removing exact duplicates, while recording each change. Orders with no region should be counted and reported as a separate "unknown" group, and the analyst should check whether they are concentrated in one channel. The very large order should be investigated: if it is an error, correct it; if genuine, keep it but report the median alongside the mean, or show results with and without it.

Key takeaways

  • Know what one row represents, the keys that link tables and the data type of each field before analysing data.
  • Data quality has several dimensions, including accuracy, completeness, consistency, validity, uniqueness and timeliness.
  • Simple checks, especially reconciling to a trusted total, catch most quality problems early.
  • Clean data systematically on a copy, record every step and explain any change in totals, particularly after joins.
  • Judge data quality against its purpose, state limitations openly and minimise personal data used in analysis.

Unit check

Create a free account to answer the check, save your progress and receive your free certificate.

Create a free account Log in
← Unit 1 Unit 3 →
WhatsApp