PRODUCTION FLOWSTransform

Transformation Fundamentals

How data moves in production — pick a topic on the left and its full breakdown loads here: the mental model, real pipeline diagrams and worked examples, failure modes, and the habits that keep data flowing correctly and on time.

18 min readTopics chapter readerLevel · Building & Orchestration
01 · Orientation

What You'll Master Here

clean (make it valid), shape (combine it), aggregate (summarise it). Do them in that sequence and the result is trustworthy.

4 min · Topic 1 of 8

Transformation is the stage where raw, untrustworthy data becomes data people can build decisions on. It is the "T" in ETL/ELT and the part most people picture when they hear "data pipeline". This chapter teaches the fundamentals that apply no matter which tool (SQL, dbt, Spark) you use.

The core idea is that almost every transformation is one of three jobs, cleaning, shaping, or aggregating, applied in that order. Get the jobs and the order right and your transformations are correct and easy to reason about. Get them wrong, usually by aggregating before cleaning, and you produce confident, wrong numbers.

By the end you will be able to take a messy raw table and turn it into a trustworthy metric step by step, and explain why each step happens where it does. You will also understand why set-based thinking (one operation over all rows) beats row-by-row loops at the scales data engineers actually work at.

Core mental model

Transformation is three jobs in order: clean (make it valid), shape (combine it), aggregate (summarise it). Do them in that sequence and the result is trustworthy.

Why it matters

Transformation is where correctness is won or lost. Unlike a crash, a transformation bug produces no error, just wrong numbers that look fine and get acted on. Mastering the fundamentals is how you avoid being the source of "the dashboard is wrong".

transformation
Turning raw data into trustworthy data by cleaning, shaping, and aggregating it.
cleaning
Making data valid: dropping bad rows, fixing types, standardising, de-duplicating.
shaping
Combining data: filtering, joining, and enriching into one coherent structure.
aggregating
Summarising rows into metrics: counts, sums, and rollups.
Common mistake

Treating transformation as "just writing some SQL". You skip the disciplined order (clean → shape → aggregate) and bake bad rows into metrics nobody can untangle.

Better habit

Classify every transform as cleaning, shaping, or aggregating.

Always clean before you aggregate.

Prefer set-based operations over row-by-row loops.

The big idea

Clean, then shape, then aggregate. This order is not a style preference; doing it out of order is how wrong numbers are born. Hold the order and most transformation bugs disappear.

How to study this chapter

Read the three-jobs topic, then each job with its worked example, then the row-vs-set topic. Notice how each example cleans before it aggregates.

Remember this

Transformation turns raw data into trustworthy data through three ordered jobs, clean, shape, aggregate; the order is the discipline that keeps metrics correct.

Practice2 prompts
  1. Name the three transformation jobs and the order to apply them.
  2. Explain why aggregating before cleaning produces untrustworthy numbers.