- Fact table
In
data warehousing , a fact table consists of the measurements, metrics orfacts of abusiness process . It is often located at the centre of astar schema , surrounded bydimension table s.Fact tables provide the (usually) additive values which act as independent variables by which dimensional attributes are analyzed. Fact tables are often defined by their "grain". The grain of a fact table represents the most atomic level by which the facts may be defined. The grain of a SALES fact table might be stated as "Sales volume by Day by Product by Store". Each record in this fact table is therefore uniquely defined by a day, product and store. Other dimensions might be members of this fact table (such as location/region) but these add nothing to the uniqueness of the fact records. These "affiliate dimensions" allow for additional slices of the independent facts but generally provide insights at a higher level of aggregation (region is made up of many stores)
Example
If the
business process is SALES, then the corresponding fact table will typically contain values representing bothraw fact s andaggregation s such as:
* "$12,000", being "sales for New York store for 15-Jan-2005"
* "$34,000", being "sales for Los Angeles store for 15-Jan-2005"
* "$22,000", being "sales for New York store for 16-Jan-2005"
* "$40,000", being "sales for Los Angeles store for 16-Jan-2005"
* "$21,000", being "average daily sales for Los Angeles Store for Jan-2005"
* "$65,000", being "average daily sales for Los Angeles Store for Feb-2005"
* "$33,000", being "average daily sales for Los Angeles Store for year 2005""average monthly sales" is a measurement which is stored in the fact table. The fact table also containsforeign key s from thedimension table s, wheretime series (e.g. dates) and other dimensions (e.g. store location, salesman, product) are stored.Fact TableThe centralized table in a star schema is called as FACT table. A fact table typically has two types of columns: those that contain facts and those that are foreign keys to dimension tables. The primary key of a fact table is usually a composite key that is made up of all of its foreign keys.Fact tables store different types of measures like additive, non additive and semi additive measures.
Measure Types * Additive - Measures that can be added across all dimensions. * Non Additive - Measures that cannot be added across all dimensions. * Semi Additive - Measures that can be added across few dimensions and not with others.
A fact table might contain either detail level facts or facts that have been aggregated (fact tables that contain aggregated facts are often instead called summary tables).
In the real world, it is possible to have a fact table that contains no measures or facts. These tables are called as Factless Fact tables.
* Steps in designing Fact Table Identify a business process for analysis(like sales). * Identify measures or facts (sales dollar). * Identify dimensions for facts(product dimension, location dimension, time dimension, organization dimension). * List the columns that describe each dimension.(region name, branch name, region name). * Determine the lowest level of summary in a fact table(sales dollar).
Wikimedia Foundation. 2010.