Inner joins reduce result sets. Outer joins increase result sets. Therefore inner joins should be performed before outer joins. If you first perform an outer join and subsequently an inner join, the desired increasing of the result set during the outer join is lost.
If you are working with cube models, you typically join the tables within a dimension and within a fact. Afterwards, you create the joins between the fact tables and the dimension tables. You can view the sequence of the joins within a dimension or a fact on the Joins tab in the Properties view of the dimension or the fact. Table joins between a fact and a dimension are not ordered. You can view the list of joins between a fact and a dimension in the Joins tab of the Properties view of the input model.
| PD_ID | TIME_ID | SALES_AMOUNT |
|---|---|---|
| 1 | 11/01/2008 | 10 |
| 99 | 12/02/2008 | 20 |
| PD_ID | PD_NAME | PDGROUP_ID |
|---|---|---|
| 1 | Bonita Mirror 2 | 1 |
| 2 | Mera T-Shirt 50 | 2 |
| PDGROUP_ID | PDGROUP_NAME |
|---|---|
| 1 | Furniture |
| 2 | Sportswear |
SELECT SALES.*, PRODUCTS.PD_NAME, PDGROUPS.*
FROM (SALES LEFT OUTER JOIN PRODUCTS ON SALES.PD_ID=PRODUCTS.PD_ID)
INNER JOIN PDGROUPS ON PRODUCTS.PDGRP_ID=PDGROUPS.PDGRP_ID;
| PD_ID | TIME_ID | SALES_AMOUNT | PD_NAME | PDGRP_ID | PDGRP_NAME |
|---|---|---|---|---|---|
| 1 | Nov 1. 2008 | 10 | Bonita Mirror 2 | 1 | Furniture |
SELECT SALES.*, PRODUCTS.PD_NAME, PDGROUPS.*
FROM SALES LEFT OUTER JOIN (PRODUCTS INNER JOIN PDGROUPS ON PRODUCTS.PDGRP_ID=PDGROUPS.PDGRP_ID) ON
SALES.PD_ID=PRODUCTS.PD_ID;
| PD_ID | TIME_ID | SALES_AMOUNT | PD_NAME | PDGRP_ID | PDGRP_NAME |
|---|---|---|---|---|---|
| 1 | Nov 1. 2008 | 10 | Bonita Mirror 2 | 1 | Furniture |
| 99 | Dec 2, 2008 | 20 |
Defining the wrong sequence for table joins leads to undesired results. The different result sets in the table Table 4 and Table 5 show that the inner table join must be performed before the left outer table join. If you first perform the left outer join, the desired result of including also the products that are sold but accidentally not included in the PRODUCTS table is lost.
You can change the sequence of the table joins by selecting a join from the list and clicking Move the Selected Join Up or Move the Selected Join Down.
You can view the sequence of the fact-to-fact joins in the Joins Tab of the Properties View of the facts. The sequence of fact-to-fact joins cannot be changed.
You can view the list of fact-to-dimension joins in the Joins Tab of the Properties View of the input model. Fact-to-dimension joins are not ordered.