Search code examples
analyticsdata-warehousedimensional-modelingstar-schema

Dimensional Model: Appointments-Fact or Dimension


When designing a dimensional model for analyzing the scheduling process in a clinic, is a appointment the grain In the fact table?

If an appointment is the grain, how does one calculate the appointment attributes like the overbooked attribute?


Solution

  • In modelling scenarios like this it's useful to think about the process vs the entity - for example there is a process of booking and attending an appointment, which can be modelled as a fact, and an entity of the appointment (with all it's attributes) that is associated with the process.

    To model the process one option is to use the technique of "accumulating snapshot" facts, where fact rows are being updated over time. To model the entity you could create a dimension of all appointments, but generally you want to avoid creating dimensions that have as many rows as the fact table so one approach is the "junk dimension" that contains unique combinations of a subset of the attributes (e.g. status flags).

    Joy Mundy of the Kimball Group discusses a similar design scenario in an article here.