开发者

Do we have to use fact table for reports?

开发者 https://www.devze.com 2023-03-15 19:05 出处:网络
开发者_如何学PythonI am working on building a data mart for reporting purpose. I am new to this field and looking for help.

开发者_如何学PythonI am working on building a data mart for reporting purpose. I am new to this field and looking for help.

I have a fact table and two dimension tables. The fact table has only 3 fields, its primary key and foreign key references to two dimension tables. The two dimension tables have data related to 1)phonenumbers and 2)extension numbers. (I cannot combine these dimension tables because they have different information)

As you see my fact table does not have any quantitative columns.

I want to generate a report that displays phonenumbers and corresponding extensions.

I can get this information by performing a join on the two dimension tables.

So my question is do I have to use fact table for the report? i.e Should I first get the key from phonenumber table, perform join on fact table, get extension key and perform join on extension table?

OR

Simply join the two dimension tables to generate the report because it is possible in this case?

Do we have to involve the fact table?

Thanks for reading.

Any help is appreciated.


do I have to use fact table for the report? i.e Should I first get the key from phonenumber table, perform join on fact table, get extension key and perform join on extension table?

Often, this is necessary.

Simply join the two dimension tables to generate the report because it is possible in this case?

Sometimes, this works, also.

Do we have to involve the fact table?

Depends on the relationships.

If you have a "hierarchy" of dimensional information, then the two dimensions could be directly related. In this case, the fact table doesn't tie them together. The fact ties to the detailed dimension; the detailed dimension ties to the summary. This is rare.

Dimensions change.

If you have two or more Slowly Changing Dimensions, then your dimensions may include lots of "previous" relationship information.

Fact 1: Phone xxx-xxx-xxxx, Extension yyyy
Fact 2: Phone xxx-xxx-xxxx, Extension zzzz

Then, another load applies an SCD rule to modify zzzz to aaaa, as of 7/1/11 You may have the old dimension values available, as well as the new dimension values, with an applicable date range.

Now, the fact (and the date range) are required to define which copy of the dimension value you're going to get.

Fact 2: Phone xxx-xxx-xxxx, Extension zzzz, from beginning to before 7/1/11.
Fact 2: Phone xxx-xxx-xxxx, Extension aaaa, from 7/1/11 to end.

So, you may need the fact, dimensions and time to sort out the relationships.

0

精彩评论

暂无评论...
验证码 换一张
取 消