Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Use the surrogate key Rate Topic Display Mode Topic Options
Author
 Message
 Posted Monday, November 5, 2012 5:32 PM
 SSC Veteran Group: General Forum Members Last Login: Sunday, November 6, 2016 9:49 AM Points: 278, Visits: 777
 Here is the scenario. I have a fact table that looks like the following:factEmployeeWorkHoursPK IDLastNameFirstNameHoursThe fact table joins to a dimension table that looks like the following:dimOrganizationPK IDEmployeeLastNameEmployeeFirstNameStoreStoreManagerRegionalManagerVPRegionStateBut there is a problem. The Employee can be assigned to more than one store and therefore can have more than one store manager, region, etc. If I join the fact table to the dim table during ETL to get the surrogate key/PK from the dim table, I will have multiple PKs per fact table row. I know that Kimball wants to have an FK in the fact table that joins the PK in the dimension table, but is that prudent in this case?
Post #1381327
 Posted Monday, November 12, 2012 9:29 AM
 Hall of Fame Group: General Forum Members Last Login: Tuesday, January 28, 2014 8:15 AM Points: 3,065, Visits: 4,639
 imani_technology (11/5/2012)Here is the scenario. I have a fact table that looks like the following:factEmployeeWorkHoursPK IDLastNameFirstNameHoursThe fact table joins to a dimension table that looks like the following:dimOrganizationPK IDEmployeeLastNameEmployeeFirstNameStoreStoreManagerRegionalManagerVPRegionStateBut there is a problem. The Employee can be assigned to more than one store and therefore can have more than one store manager, region, etc. If I join the fact table to the dim table during ETL to get the surrogate key/PK from the dim table, I will have multiple PKs per fact table row. I know that Kimball wants to have an FK in the fact table that joins the PK in the dimension table, but is that prudent in this case?It all comes down to granularity.If business requirements call for collecting the employee hours not matter where the employee was working then you shouldn't care about different stores, different managers, etc.If business requirements call for collecting detailed information about where and with who the employee was working then the design lacks much needed columns to go down to such granularity.Either way, the design of the fact table (for starters) looks a bit fuzzy to me. Either that fact table expects to have a single row per employee which is the same as saying that the table is not a fact table but a summary table OR, table expects to store as many rows as needed for employee so to track where the employee has worked... in this case having the name of the employee on each row is really not a good idea.Would you please give more details? _____________________________________Pablo (Paul) BerzukovAuthor of Understanding Database Administration available at Amazon and other bookstores.Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Post #1383739
 Posted Wednesday, November 21, 2012 11:35 AM
 Right there with Babe Group: General Forum Members Last Login: Friday, February 6, 2015 9:34 AM Points: 759, Visits: 1,033
 imani_technology (11/5/2012)Here is the scenario. I have a fact table that looks like the following:factEmployeeWorkHoursPK IDLastNameFirstNameHoursIs there a reason why you don't have an employee dimension? That way on your fact table, you could have two dimensions (one for employee, one for store), and employees could work quite happily across multiple stores without it being problematic.You would end up with a structure on your fact table such as:factEmployeeWorkHoursPK IDEmployee Dimension KeyStore Dimension KeyHoursThere's a common misconception that dimensional data warehouses are not normalised. While there is some truth in that, it's better to think of them as denormalised in specific cases. In general, fact tables are heavily normalised. That means that if you have repeated sequences within a fact table, the chances are you are missing a dimension.
Post #1387549

 Permissions