Hello,
I have to solve a larger modeling problem: one fact table linked to 15-20 dimensions, second fact table linked 2 anothers extra dimensions and the 2 facts are in 1-N relation linked by an id (we can consider it like a pseudo dimension). I want to cross any mesure from the Fact2 by any of the 15 dimensions and vice versa any mesure from the Fact 1 by any of the 2 extra dimensions.
To explain that I find a simple example (orders-details) that I will describe below. I seems to work with my idea but I need a confirmation before applying the same principle to my larger case.
Questions:
- Find the quantity (F_DETAILS) of products sold by a specific client (D_CLIENT) ?
- The orders total amount (F_COMANDES) where a specfic item (D_ITEM) was involved ?
So I extract a dimension (FK_COMANDES) table from the first order table (F_COMANDES) only to link this preudo-dimension to the both fact tables. Then I need to add an extra join expresion ( 1 = 1 ) to solve the first question (empty fields if not).
The physical diagram ( Orders = Commandes in french)
The data:
F_COMANDES (the prefix A_ is used for marking the alias table)
ID CLIENT_ID COMANDE_ID TOTAL_COMANDE
F_DETAILS:
ID COMANDE_ID ITEM_ID QUANTITY UNIT_PRICE
To solve the second question I added a extra field 'Total des commandes' like below:
What I obtain in OAC is good. The only minor drawback is that I need to chose each time another mesure (I cannot fusion 'Total commande' and 'Total des commandes' in one single mesure)
Q1: Find the quantity (F_DETAILS) of products sold by a specific client (D_CLIENT) ?
The quantity is good and the green bordered total also. The other total is multiplied 2 and 3 times respectively
Q2: The orders total amount (F_COMANDES) where a specfic item (D_ITEM) was involved ?
The blue borderd total is good. The other total is the sum of the 3 orders total (not good for the the item Article 1)
Did I made the things properly?
Thanks,
Daniel