I want to set up a reusable data model (probably in a data mart), but I am consistently running into issues in doing so. I believe the issue is that my data model is mostly made up of fact tables (some with 30m rows).
For instance, I have a medicines prescription table. This has a unique row for each prescription as is probably what you would call the core fact table.
Then I have a schedule table which details the dose / frequency, etc of each individual prescription. However, there can be more than one schedule for each prescription, ie if the user changes the dose, etc.
Then I have an administrations table, which has a row for each time the medicine was given. These relate back to a single line in the schedule table, and there can be many administrations over the course of each schedule.
So, re above, I could have one prescription, which has 5 schedules, and 50 admins.
Then I have various other related fact tables, which I won’t go into but basically are all either directly related to the core prescription table or related to another fact table that is related to the prescription table.
So basically, any data model I try and create is basically just like a cascading list of fact tables, with a few branches and doesn’t look like anything online. Everything I read online says to either combine fact tables into one large table, or join them on dimensions. I don’t think either of these address this scenario.
I seem to then run into issues with the relationships when trying to build measures, etc.
My question is, in theory, how would you deal with this type of situation?
Like I say, I wanted to create a single model that could be used by many reports, but perhaps a one-size fits all doesn’t always work?
Many thanks in advance.