Analytics Resources: Insights, Best Practices,

Case Studies and More

close
Written by Hemanta Banerjee
on November 16, 2010

Lets take a simple scenario. I want to generate a report that shows the sales by showroom, and the report should display all the showrooms in the report. For the showroom with no sales it should display the region with a NULL value for sales.

image

The usual join (also called as inner join) will not work in this scenario. We need what is called as an outer join. If you want to know more about outer joins you can checkout the Wikipedia link here.

To enable outer join you need to first set the ANSI92 parameter to Yes. This will change the query from the simple join to an an inner join syntax with from clause as shown below.

image

You can also enable the FILTER_IN_FROM parameter. This pushes the where clause of the join inside the from which reduces the number of records in the join condition and will greatly improve performance.

image

Now we can setup our outer join. As shown below we can setup the right outer join betwen the fact table and the showroom dimension table.

image

The effect of this is that all showrooms irrespective of whether they had a sale or not will be returned by the query.

image

So in conclusion while it is easy to setup outer joins in the universe, one should be very careful when using outer joins as it can result in a cartesian product of all rows especially when using full outer join.

You may also like:

Data Modeling Business Intelligence PowerBI

Dimension Specific Aggregation in Power BI

When dealing with facts and measures in any BI tool, you can set the aggregation method (such as sum, count, average etc...

Oracle BI Applications Data Modeling OBIEE 12c

eBusiness Suite and Oracle BI Applications Security

By default, an Oracle Business Intelligence installation is configured with an authentication provider that uses the Ora...

Data Modeling Oracle DB OBIEE 12c

Standard Date Dimension Build

The SQL Below generates a date dimension table where the DATE_WID is a chronological key. This is essential for getting ...