简体   繁体   English

事实表的无事实事实和历史

[英]Factless fact and history for fact table

According to Kimball, Factless fact table are“ fact tables that have no facts but captures the many-to-many relationship between dimension keys.根据 Kimball 的说法, Factless 事实表是“没有事实但捕获维度键之间的多对多关系的事实表。 ” 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).它本质上是维度的交集(它只包含维度键)。 In my case, I am creating a fact table which captures for each employee :就我而言,我正在创建一个事实表,用于捕获每个员工:

  • their function他们的功能
  • their role他们的角色
  • their main manager他们的主要经理
  • their department他们的部门
  • their status他们的身份
  • EntryDate入境日期
  • ExitDate退出日期

The event related to my fact table are : - when any change is applied to the function, role main manager.. of an already existing employee - or a new employee has arrived与我的事实表相关的事件是: - 当任何更改应用于现有员工的职能、主要经理角色时 - 或新员工到任

I am adding for historical need in my fact :我在我的事实中添加历史需要:

  • BI_StartDate BI_开始日期
  • BI_EndDate BI_结束日期

Is my fact table a Factless fact ?我的事实表是 Factless 事实吗?
The fact is containing the history : How can I track the date of updates if I am having an update of function and type of an employee of the same period ?事实包含历史:如果我有同一时期员工的功能和类型更新,我如何跟踪更新日期?

This is an example of a Type II dimension.这是类型 II 维度的示例。

Notes: The current record should have a null BI_EndDate注意:当前记录应该有一个空的 BI_EndDate

You can either join on Current Info by joining on EmpID and BI_EndDate is null您可以通过加入on EmpID and BI_EndDate is null来加入当前信息

or或者

You can join on the record at the time您可以在当时的记录中加入

EmpID and [Comparison date]>=BI_StartDate and [Comparison date] <= ISNULL(BI_EndDate,'20991231')

Futhermore, I think your example of a factless fact seems more in line with many to many relationships.此外,我认为你举的一个不真实的事实的例子似乎更符合多对多的关系。

As an example, think of students and classes.例如,想想学生和班级。 There are many students and many classes but the intersection of these two is a studentClass table.有很多学生和很多班级,但这两者的交集是一个 studentClass 表。 (with the official title of studentEnrollment but that not important). (带有 studentEnrollment 的官方名称,但这并不重要)。

I don't necessarily call this factless as the measure coming from this table are counts.我不一定认为这是不真实的,因为来自这张表的衡量标准是计数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM