Suppose I have tables as indicated below. I'm trying to create correct fact tables.
If I combine both tables into one fact table, I would be repeating the sales measure since each sale contains at least two items (admin fee, cleaning and so on - number of items can vary) that contribute to the overall sale. For car 1, the overall sale would therefore be 5000 + 50 + 100. I cannot simply aggregate either because sales needs to be itemized.
Do I need to create two fact tables, or do I need to approach this in an altogether different manner? I'm tempted to link Car Sale Table to Charge Table in a 1:n fashion.
Do you have any suggestions?
Car Sale Table
car_id | sale | currency |
---|---|---|
1 | 5000 | USD |
2 | 7000 | USD |
Charge Table
charge_id | type | amount | currency | car_id |
---|---|---|---|---|
14 | admin fee | 50 | USD | 1 |
15 | cleaning | 100 | USD | 1 |
22 | parking | 10 | USD | 2 |
25 | cleaning | 70 | USD | 2 |