My question is about the fact table. Can I go with only one fact table or do I need a second one?
I’ll try to explain it with an example.
I’m in a hospital and I need to have the following data per clinic: (all the data are in day basis) (A hospital has many clinics).
1. Number of incoming patients per gender, age group, insurance type etc.
2. Number of outgoing patients per gender, age group, insurance type etc.
3. Number of transfers to another hospital again per gender, age group, insurance type but also by transfer reason.
Can number 3 go into the same fact table as 1 and 2? It has one more dimension, that is the transfer reason.
If I make a fact table like this:
1. Date
2. ClinicId
3. GenderId
4. AgeGroupId
5. InsuranceTypeId
6. TransferOutReasonId
|
7. NumberOfIncomingPatients
8. NumberOfOutgoingPatients
9. NumberOfTransfersOut
Can this work? On the same day I have
1) incoming patients with no TransferOutReasonId
2) and transfer out patients with different transfer reasons.
So I could have one record per day and dimension combination for incoming and outgoing and put 0 or null on the NumberOfTransfersOut and on TransferOutReasonId fields and then so many records as many transfer out reasons I have on that day and put 0 on the incoming and outgoing fields.
Is this good practice or not? Do I need so many fact tables depending on the combination of dimensions I have? I mean what if I have another measure that has Gender and Age as dimensions but not Insurance and perhaps it even has a new dimension let’s say disease type. Does this go in the same fact table or not? If not I have to make three fact tables to get statistical data for the same source "Clinic".
Thanks for any help
I’ll try to explain it with an example.
I’m in a hospital and I need to have the following data per clinic: (all the data are in day basis) (A hospital has many clinics).
1. Number of incoming patients per gender, age group, insurance type etc.
2. Number of outgoing patients per gender, age group, insurance type etc.
3. Number of transfers to another hospital again per gender, age group, insurance type but also by transfer reason.
Can number 3 go into the same fact table as 1 and 2? It has one more dimension, that is the transfer reason.
If I make a fact table like this:
1. Date
2. ClinicId
3. GenderId
4. AgeGroupId
5. InsuranceTypeId
6. TransferOutReasonId
|
7. NumberOfIncomingPatients
8. NumberOfOutgoingPatients
9. NumberOfTransfersOut
Can this work? On the same day I have
1) incoming patients with no TransferOutReasonId
2) and transfer out patients with different transfer reasons.
So I could have one record per day and dimension combination for incoming and outgoing and put 0 or null on the NumberOfTransfersOut and on TransferOutReasonId fields and then so many records as many transfer out reasons I have on that day and put 0 on the incoming and outgoing fields.
Is this good practice or not? Do I need so many fact tables depending on the combination of dimensions I have? I mean what if I have another measure that has Gender and Age as dimensions but not Insurance and perhaps it even has a new dimension let’s say disease type. Does this go in the same fact table or not? If not I have to make three fact tables to get statistical data for the same source "Clinic".
Thanks for any help