SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Factless fact table

A factless fact table is a fact table that does not have any measures.  It is essentially an intersection of dimensions (it contains nothing but dimensional keys).

There are two types of factless tables:  One is for capturing an event, and one is for describing conditions.

An event establishes the relationship among the dimension members from various dimensions, but there is no measured value.  The existence of the relationship itself is the fact.

This type of fact table itself can be used to generate useful reports.  You can count the number of occurrences with various criteria.  For example, you can have a factless fact table to capture student attendance, creating a row each time a student attends a class.  The following questions can be answered:

  • Which class has the least attendance?
  • Which teachers taught the most students?
  • What is the average number of attendance of a given course?

All the queries are based on the COUNT() with the GROUP BY queries.  The interesting metrics are the nested GROUP BY so you can first count and then apply other aggregate functions such as AVERAGE, MAX, MIX.

The other type of factless table is for describing conditions and is called a “coverage table” by Ralph Kimball.  It is used to support negative analysis reports.  For example, a store that did not sell a product for a given period.  To produce such a report, you need to have a factless fact table to capture all the possible combinations of products that were on sale.  You can then figure out what is missing by comparing the factless table with the sales table for the list of products that did sell.

As another example, say an investment bank assigns a broker to each customer.  Each row in this factless fact table represents a bounded time period during which a broker was assigned to a particular customer.  This factless fact table can be compared to one that tracks investment transactions to find brokers who are not interacting with their customers, brokers who conducted transactions with accounts that belong to a different broker, etc.

More info:

Factless Fact Tables by Ralph Kimball

Factless Fact Tables by Chris Adamson

James Serra's Blog

James is a big data and data warehousing technology specialist at Microsoft. He is a thought leader in the use and application of Big Data technologies, including MPP solutions involving hybrid technologies of relational data, Hadoop, and private and public cloud. Previously he was an independent consultant working as a Data Warehouse/Business Intelligence architect and developer. He is a prior SQL Server MVP with over 30 years of IT experience. James is a popular blogger (JamesSerra.com) and speaker, having presented at dozens of PASS events including the PASS Business Analytics conference and the PASS Summit. He is the author of the book “Reporting with Microsoft SQL Server 2012”. He received a Bachelor of Science degree in Computer Engineering from the University of Nevada-Las Vegas.


Leave a comment on the original post [www.jamesserra.com, opens in a new window]

Loading comments...