• imani_technology (11/5/2012)


    Here is the scenario. I have a fact table that looks like the following:

    factEmployeeWorkHours

    PK ID

    LastName

    FirstName

    Hours

    The fact table joins to a dimension table that looks like the following:

    dimOrganization

    PK ID

    EmployeeLastName

    EmployeeFirstName

    Store

    StoreManager

    RegionalManager

    VP

    Region

    State

    But 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) Berzukov

    Author 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.