TapCub is live — analytics, insights and live chat, free on one platform
Glossary

What Is a Data Table? Definition, Parts and Wide vs Long Layout

A data table organises data in rows and columns, one row per record and one column per field. Its four parts, wide versus long layouts, a worked event table with a join trap, and three rules for tables that stay usable.

Su He Reviewed by Ethan Brooks Also called table Last updated Nov 18, 2026 Glossary

Quick answer

A data table organises data in rows and columns: each row is one record, each column is one field, and each cell holds one value. A table is only reliable when you can say what one row is (one order, one event, one user), because every count and sum depends on that choice.

What is a data table, in more detail?

A data table arranges data in a grid. Each row describes one thing (a record, an observation), each column holds one kind of fact about those things (a field, a variable), and each cell holds one value. A list of orders is a data table: one row per order, with columns for order ID, date, customer and amount.

The idea is old and simple, which is why it survived. Codd (1970) built the relational database model on it, and every spreadsheet, SQL database and CSV file you will meet is a variation. What changes between tools is the rules: a CSV file has a header line and the same number of fields on every line (RFC 4180); a database table adds types and keys; an analytics event table has one row per tracked action.

The sentence that matters: a table is only useful when you can finish the phrase "one row is one …". One order. One event. One user. One user in one week. If different rows mean different things, every count, sum and average you take from the table will quietly answer a different question than the one you asked. That choice, called granularity, is covered in data granularity.

What are the four parts of a data table?

PartWhat it isExample (orders table)What goes wrong
RowOne record: one thing describedOne orderRows that mean different things, such as an order row and a refund row in the same table with no marker
ColumnOne field with a nameorder_date, amountTwo facts in one column ("$29 USD"), or one fact spread over many columns
KeyA column (or columns) whose value identifies the roworder_idDuplicate keys, which break joins and double counts
TypeWhat kind of value a column holdsdate, number, text, true/falseNumbers stored as text, dates in three formats, "N/A" mixed with blanks

The key deserves a second look. If order_id is unique, one row is one order, and you can join it with a customers table safely. If it is not unique, a join repeats rows and a sum doubles. The property of how many distinct values a column has is cardinality. Types are covered in data types, and the document that records what each column means is a data dictionary.

What is the difference between wide and long tables?

The same facts can be laid out two ways.

Sample data: weekly active days for three users over three weeks.

Wide format: one row per user, one column per week.

user_idweek_1week_2week_3
u1542
u2333
u3610

Long format: one row per user per week.

user_idweekactive_days
u115
u124
u132
u213
………

The wide table has 3 rows and 4 columns (12 cells). The long table has 3 users × 3 weeks = 9 rows and 3 columns (27 cells). Week 4 means a new column in the wide table and three new rows in the long one.

WideLong
Best forReading by eye, a final report, one row per personAnalysis, filtering, charting, joining
Adding a periodAdd a column (the structure changes)Add rows (the structure stays)
Typical question it answers easily"What did u1 do over the weeks?""What is the average active days per week?"
RiskColumn names carry data (week_1, week_2, …)Many more rows

Most analysis tools expect the long form, because a column such as week can be filtered, grouped and plotted, while week_1, week_2 and week_3 are three different columns with a data value hidden in each name. Wickham (2014) names the long, one-variable-per-column form "tidy data": each variable is a column, each observation is a row, and each type of observational unit is a table.

What does a real example look like, and what can go wrong?

Sample data: an event table where one row is one tracked event.

event_timeevent_nameuser_idplanamount
2026-03-02 09:14page_viewu1free
2026-03-02 09:15signupu1free
2026-03-02 10:02page_viewu2pro
2026-03-02 10:05purchaseu2pro49
2026-03-02 11:30page_viewu3free
2026-03-02 11:34purchaseu3free29
2026-03-03 08:50purchaseu1free29
2026-03-03 09:10page_viewu4free

The table has 8 rows and 5 columns (40 cells). Questions it answers directly:

  • How many purchases? Count rows where event_name is purchase: 3.
  • How much revenue? Sum amount over those rows: 49 + 29 + 29 = 107.
  • How many different users? Count distinct user_id: 4 (u1, u2, u3, u4).

Now the trap. Suppose you join this to a users table keyed on user_id to add each user's country, and that table has two rows for u1 (they changed country and nobody deleted the old row). u1's purchase of 29 now appears twice in the joined result, so the revenue sum becomes 49 + 29 + 29 + 29 = 136 instead of 107, a 27% overstatement (29 ÷ 107). Nothing in the join produced an error. The cause was a key that was not unique, and the symptom was a number that looked plausible.

Two checks catch it: compare the row count before and after any join (8 should stay 8), and confirm the key is unique with a count of distinct keys against a count of rows.

What three rules keep a data table usable?

  1. One row, one thing, stated in a sentence. Write "one row is one event" in the table's description. If you need an "or" in the sentence, you have two tables.
  2. One column, one kind of value, one type. Store 49 in amount and the currency in a separate column, rather than "$49". Use a single marker for missing values (blank) rather than a mix of "N/A", "-" and "none".
  3. A key that is unique per row. If no single column is unique, define it from two (for example user_id plus week), and check it every time the table is loaded.

Keep totals, notes and merged header cells out of the data area. Put them beside the table or in a separate summary, or the next import will read the "Total" row as a customer.

What mistakes do people make with data tables?

  • Putting data in column names. sales_jan, sales_feb and so on look neat and block filtering by month. Reshape to long.
  • Mixing grain. Daily rows and monthly total rows in the same table make every sum wrong.
  • Treating a spreadsheet's look as its structure. Colours, merged cells and blank separator rows mean something to a person and nothing to a program.
  • Trusting a join without checking the row count. See the 136 against 107 above.
  • Confusing the data table with the chart or report built from it. A pivot table or a chart is a summary of a table; the table underneath is the record. Keep the underlying rows if you may need to answer a different question later.
  • Inconsistent types in one column. One text value in a number column can turn the whole column into text on import.

How do data tables show up in TapCub?

TapCub's raw data is an event table like the one above: one row per tracked event, with properties as extra columns. These are the places where table structure matters in practice.

  1. Plan the table before you collect it. In All-platform analytics › Data › Tracking plan, each event is a row with an event name, display name, category, platform, trigger, properties (name, type, whether required, example), owner and status. The plan is itself a data table, one row per event, and it works best if you decide the row meaning and the property types before developers write code.
  2. Import a CSV as events. In All-platform analytics › Data › Data import, the CSV events type means one row is one event, with columns such as time, event name and user ID. The wizard shows the first 20 rows and maps columns to fields; a file holds at most 100,000 rows, so split larger ones. With no user ID mapped, every row becomes its own anonymous visitor, so rows cannot be merged into one person.
  3. Import a CSV of user attributes. The CSV user properties type means one row is one user, with distinct_id (or email or phone) plus properties. That is a different table from the events table: same people, a different row meaning.
  4. Attach a lookup table. A dimension table stores attributes such as product category against a key property, so they attach to events without changing tracking. It needs a unique key (the first column), at most 30 columns and at most 50,000 rows, and the coverage figure shows what share of recent events found a matching key, which is the join check from the example above.
  5. Export the rows. In All-platform analytics › Data › Data export, you can create an asynchronous export of events, sessions or people for a date range. Charts show aggregates; the export is the table underneath.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Su He

Data Analyst

Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is a data table in simple terms?

A grid of rows and columns. Each row describes one thing, such as an order or a visit, and each column holds one fact about those things, such as date or amount. Everything in a database, spreadsheet or CSV file is built from this layout.

What is the difference between a data table and a database?

A data table is one grid of rows and columns. A database holds many tables plus the rules that connect them, such as keys that link orders to customers, and a way to query them.

What is the difference between a data table and a pivot table?

A data table stores the raw records, one row per thing. A pivot table summarises it, for example total revenue by plan. Keep the underlying table, because the summary cannot answer a different question later.

Should I use a wide or a long table?

Use long for analysis, filtering and charts, because a period or category becomes a column you can group by. Use wide for a final report people read by eye. If column names contain data, such as week_1 and week_2, reshape to long.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics