Skip to content

Factless fact table

A fact table with foreign keys to its dimensions and no numeric measures. Each row records that something happened, such as a student attending a class, or that a condition applied, such as a product being on promotion.

Also: factless fact · factless fact tables · coverage table

On this page · 7 sections
  1. Definition
  2. Example
  3. Why it matters
  4. Common mistakes
  5. FAQ
  6. Go deeper
  7. Related terms

A factless fact table records events that have nothing to measure. When a student attends a class, the event is well defined: a date, a student, a class, a room. There is no amount or quantity attached to it. The row is made entirely of dimension keys, and the fact is that these things came together at that time.

Analysis on such a table is counting. How many students attended each class, how many customers were contacted in each campaign, how many days an employee was on site. Some designs add a column that always holds 1 so that tools can sum it, which does not change what the table is.

Ralph Kimball describes a second use: finding what did not happen. A coverage table lists everything that could have produced an event, such as every product on promotion in every store each day. Subtracting the events that occurred, the sales, from the coverage leaves the promoted products that did not sell. Sales data alone cannot show that, because a sale that never happened has no row.

with not_sold as (
  select date_key, product_key from fct_promotion_coverage
  except
  select date_key, product_key from fct_sales
)
select
  d.calendar_date,
  p.product_name
from not_sold n
join dim_dates d on d.date_key = n.date_key
join dim_products p on p.product_key = n.product_key
order by d.calendar_date, p.product_name
Coverage minus activity. The coverage table lists every product on promotion each day and has no measures. Removing the product-days that had a sale leaves two rows in the sample data: the promoted products that did not sell.
Why it matters

Some of the most useful questions are about absence: which promoted products did not sell, which enrolled students did not attend, which accounts were assigned to a rep and never contacted. They need a table that records the possibility and not only the outcome.

It also replaces a workaround, which is to attach relationship data to a dimension. Which products were on which promotion on which day is many-to-many and changes daily. That is an event-like fact and belongs in a table of its own.

Common mistakes
  • Adding a measure from another process to fill the empty space, such as putting sales amount on a promotion coverage row. The two have different grains and the amount will be wrong when summed.
  • Counting rows after joining the coverage table to a sales table at a finer grain, which counts sales lines and not covered products.
  • Treating a table without measures as a modeling error and folding it into a dimension, where the many-to-many relationship cannot be represented.
FAQ
What is an example of a factless fact table?
Class attendance: one row per student per class per day, holding only the keys for the date, the student, the class, and the instructor. Others are a product-on-promotion table, an employee-in-department assignment table, and a table of marketing emails sent. In each, the row itself is the information and there is no amount to store.
Why would a fact table have no facts?
Because the event has no natural numeric measurement. Attendance, eligibility, assignment, and coverage either happened or did not. The table is still a fact table in the sense that matters: it has a declared grain, it joins to dimensions, and it is analyzed by counting rows grouped by dimension attributes.
How do you query a factless fact table?
Count rows, grouped by a dimension attribute: attendance per class, contacts per campaign. To find what did not happen, take the set of keys in the coverage table and remove the set that appears in the activity table, using EXCEPT, NOT EXISTS, or a left join filtered to the rows with no match.