Time and date dimension in data warehouse

后端 未结 4 1189
灰色年华
灰色年华 2021-02-01 07:36

I\'m building a data warehouse. Each fact has it\'s timestamp. I need to create reports by day, month, quarter but by hours too. Looking at the examples I see that

4条回答
  •  [愿得一人]
    2021-02-01 07:57

    I would recommend having seperate dimension for date and time. Date Dimension would have 1 record for each date as part of identified valid range of dates. For example: 01/01/1980 to 12/31/2025.

    And a seperate dimension for time having 86400 records with each second having a record identified by the time key.

    In the fact records, where u need date and time both, add both keys having references to these conformed dimensions.

提交回复
热议问题