Factless Fact Table

A factless fact table is a fact table that does not have any measures. It is essentially an intersection of dimensions. On the surface, a factless fact table does not make sense, since a fact table is, after all, about facts. However, there are situations where having this kind of relationship makes sense in data warehousing.html

For example, think about a record of student attendance in classes. In this case, the fact table would consist of 3 dimensions: the student dimension, the time dimension, and the class dimension. This factless fact table would look like the following:less

Factless Fact Table Example

The only measure that you can possibly attach to each combination is "1" to show the presence of that particular combination. However, adding a fact that always shows 1 is redundant because we can simply use the COUNT function in SQL to answer the same questions.flex

Factless fact tables offer the most flexibility in data warehouse design. For example, one can easily answer the following questions with this factless fact table:this

  • How many students attended a particular class on a particular day?spa

  • How many classes on average does a student attend on a given day?翻译

Without using a factless fact table, we will need two separate fact tables to answer the above two questions. With the above factless fact table, it becomes the only fact table that's needed.orm

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
htm

如下内容转自 http://www.cnblogs.com/lijun4017/archive/2010/08/04/1792293.html blog

浅析非事实型事实表事件

在维度建模的数据仓库中,有一种事实表叫Factless Fact Table,中文通常翻译为“非事实型事实表”。在事实表中,一般会保存十个左右的维度外键和多个度量事实,度量事实是事实表的关键所在。在非事实型事实表中没有这些度量事实,只有多个维度外键。非事实型事实表一般用来跟踪一些事件或者说明某些活动的范围。下面举例来进行说明。

第一类非事实型事实表是用来跟踪事件的事实表。例如:学生注册事件,学校须要对学生按学期进行跟踪。维度表包括学期维度、课程维度、系维度、学生维度、注册专业维度和取得学分维度,而事实表是由这些维度的主键组成,事实只有注册数,而且恒为1。这样的事实表能够回答大量关于大学开课注册方面的问题,主要是回答各类状况下的注册数。

第二类非事实型事实表是用来讲明某些活动范围的事实表。例如:促销范围事实表。一般销售事实表能够回答如促销商品的销售状况,可是对于那些没有销售出去的促销商品无法回答。这时,经过创建促销范围事实表,将商场须要促销的商品单独创建事实表保存。而后,经过这个促销范围事实表和销售事实表便可得出哪些促销商品没有销售出去。这样的促销范围事实表只是用来讲明促销活动的范围,其中没有任何事实度量。

如下内容转自 http://www.cnblogs.com/lijun4017/archive/2010/08/04/1792440.html

咱们用非事实型事实表来记录维度之间的多对多关系,可是关系上没有数字或者文本的事实。非事实型事实表通常用来记录事件或者范围信息。常见的例子如:标识产品的促销范围;记录学生出席或者注册事件等。

在本TIP中咱们用非事实型事实表来补充缓慢变化维的处理策略。

对于一个大型的B2C企业来讲,会有上千万的客户。对于这种大型的客户表,须要跟踪客户的变化状况,咱们能够采用TYPE 2的缓慢变化维策略来进行应对。例如,一个大的客户表,咱们尽可能减少TYPE 2生成的记录数,创建了四个微型维度,分别是客户信用属性、客户参数、市场倾向和客户详细地址。这样在交易粒度事实表中咱们会保留客户相关信息的五个外键,这些外键关联到客户不一样的信息。

同时,咱们还应该支持客户的总体信息的访问。为了能方便访问客户的总体信息,咱们能够创建另外一个周期快照事实表,天天加载客户维度和其相关联的微型维度的关系。可是这样就须要天天保存上千万记录的快照,不是一个好的选择。

这时,咱们能够考虑创建非事实型事实表来解决这个问题。咱们能够创建一个事实表,其中只有客户维度和其对应微型维度的外键,当客户有TYPE 2变化时或者产生新的微型维度记录时,咱们能够在这个事实表中插入一条记录。在这个事实表中还能够加入生效日期和失效日期,能够加一列用来标识是当前客户信息记录,能够加变化缘由列

相关文章
相关标签/搜索