schemadata-warehousebusiness-intelligencefact-table

In this specific example, can I have more than one fact table?


I have the following assignment for Business Intelligence Class:

I was thinking about the following fact tables:

Fact_CustBill
Dim_Time_ID
Dim_Club_ID
Dim_Cust_ID
Fact_BilledAmount
Fact_EmployeeEarns
Dim_Time_ID
Dim_Club_ID
Dim_Emp_ID
Fact_EarnedAmount
Fact_WorkSpecial
Dim_TimeSpecial_ID
Fact_HoursWorked

I'm thinking about these fact tables just based on an example I was given during class. I'm not sure about Dim_Club_ID being necessary on the employee tables and I'm also not 100% about the "Fact_WorkSpecial". Is my reasoning correct or not really?


Solution

  • You can have multiple fact tables. And you should have multiple fact tables if you’re recording data of different granularity.

    But in this case one fact table is enough for both employee revenues and amounts biller to customers. The grain is the same: the babysitting job.

    So you can have one fact table linking to club, date, customer and employee dimensions, with multiple measures: hours worked, amount billed to client and amount earned by employee.

    When you want to report you can pick only one of those measures and query on it. But it will give you more info: whether some clients prefer to work with certain employees.

    The trick here is your date dimension. It needs calendar year, month and day, but also year of week (iso 8601), week number and day of the week.