Plotlay Open the app →

Learn · Data and analysis · Lesson 26 of 35

Link tables by a key

You willJoin two tables by the column they share, then colour the map by a column of the other table, group a chart by it and use it in formulas.
Time4 min
Why it mattersSchools in one file, enrolments by year in another: linked by the school code, they work as one.

Try it in Plotlay → Opens an example project with this lesson beside it. Nothing to install.

Steps

  1. Open Data (Alt+5), then Analysis, and add the second table: paste it or open a CSV or Excel file.
  2. Choose Links between tables in the list. Every table, data layer and linked dataset is a card with its columns.
  3. Drag the key column of one card onto the matching column of another, or choose Link two tables and fill in the sentence: Each row in Schools matches rows in Enrolments by key = school_code.
  4. Read the match report before you choose Link tables: how many keys matched, the ones that didn’t with the closest key, and whether each school has one row or many.
  5. Under the link, pick a column and how its rows combine (total, average, median, lowest, highest, count or latest), then Colour the map. A table by year steps with the time slider.
  6. Make a chart of the second table: its columns now include Schools.level, to group or filter by.

Tips

  • Keys match after tidying: spaces, capitals, dashes and leading zeros don’t count, and 8135 matches "8135".
  • In a formula, Schools.level reads the one linked row, and sum(Enrolments.students), median(...) or count(Enrolments) combine the many.
  • A key made of two columns (a state and a school code): choose + A second key column.
  • Links can go one more step: an enrolment row reaches a school, and the school reaches its suburb’s table.

Common mistakes

  • Linking two tables where keys repeat on both sides: the link says Many to many, and totals would count rows more than once. Link each to a table with one row per key instead.
  • Reading a many side as one value: Enrolments.students alone fails on a school with several rows. Combine it, as sum(Enrolments.students).
Check yourself

Each school has a row per year in Enrolments. How do you colour the schools by their students in 2024?

Words in this lesson

Layer
A group of shapes, rooms and items in a project, listed in the Layers tab. A hidden layer is left out of the plan, 3D and documents until you show it again.

Related lessons

Steps checked in the app on 13 November 2026.