Book Image

Oracle Business Intelligence 11g R1 Cookbook

By : Cuneyt Yilmaz
Book Image

Oracle Business Intelligence 11g R1 Cookbook

By: Cuneyt Yilmaz

Overview of this book

<p>Extracting meaningful and valuable business information from transactional databases is crucial for any organization. OBIEE 11g is a reporting tool that satisfies all the business requirements regarding complex reporting. It consists of a powerful back-end engine with a repository and a highly customizable graphical web interface.</p> <p>Oracle Business Intelligence 11g R1 Cookbook provides all the key concepts of the product including the architecture of the BI Server. This practical guide shows each and every step of creating analytical reports starting from building a well-designed repository. You will learn how to create analytical reports that will support different business perspectives. <br /><br />This practical guide covers how to implement OBIEE 11g suite in order to enable BI developers to create sophisticated web based reports. All of tasks will be covered step by step in detail. <br /><br />You will explore the architecture of the Oracle Business Intelligence Server and learn how to build the repository (RPD). We will also discuss how to implement the business rules in the repository with real-life scenarios.</p> <p>Best practices of a successful BI implementation are esssential for any BI developer so they are also covered in depth.If you are planning to implement OBIEE 11g suite, this step-by-step guide is a must have resource.All the key tasks are defined in detail and supported with diagrams and screenshots.</p>
Table of Contents (19 chapters)
Oracle Business Intelligence 11g R1 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding calculations to the fact table


Business users are going to be interested in some calculations of the values in the measure to compare some values. So at the end, they will need valuable information from the existing fact tables that contain measures. For example, in our case they may be interested in comparing the units ordered with the units actually shipped. The business solution of this scenario is to add new calculations into the logical fact table. There can be another solution such as adding these calculations into the data warehouse and making the calculations at the database level. But this solution will take more time. So that's the reason that we're going to add new calculations into the BMM layer.

There are three types of methods that we can use:

  • Creating calculations based on logical columns

  • Creating calculations based on physical columns

  • Creating calculations using the Calculation Wizard (based on logical columns)

Besides these calculations, we're going to cover time-based calculations in Chapter 3, Using Aggregates and the Time Series Functions.

How to do it...

  1. First, we're going to use the first method, which is about calculations based on logical column sources. We're going to expand the logical fact table and see the list of existing columns, then right-click on the table and navigate to New Object | Logical Column.... It's going to open the Logical Column properties.

  2. By default, this Logical Column is not mapped to any physical column. When you click on the Column Source tab in the same window, you can see that it's not mapped yet. We're going to select the Derived from existing columns using an expression option box from the Column Source Type section. You'll see the Edit Expression icon.

  3. When you click on the Edit Expression icon, it's going to open Expression Builder where we're going to write the formula and click on the OK button.

    "Sales"."Fact_Sales"."Units Ordered" – "Sales"."Fact_Sales"."Units Shipped"
  4. By using this method, we can see the differences between the two measures such as Units Ordered and Units Shipped. The most important point is how the calculations and aggregations are done in this method. When you use the logical columns in the calculations, it means that the aggregation rule is going to be applied before the calculation. So the formula is as follows:

    SUM (UNITS ORDERED) – SUM (UNITS SHIPPED)

    The formula will not be:

    SUM (UNITS ORDERED – UNITS SHIPPED)
  5. When it comes to the second method, that is when the calculations will be based on physical columns, we're going to again create the Logical Column in the logical fact table. But this time we're not going to change anything in the Column Source tab, because we've already discussed that physical column mapping can be only accessed from Logical Table Source.

  6. And when we open the Logical Table Source window, we'll see that the new column is not mapped yet.

  7. Again we're going to open Expression Builder and write the formula, but this time physical columns are going to be used in the formula.

  8. As a result you'll have another measure that calculates the difference between the units ordered and the units shipped. Now the aggregation rule is going to be applied after the calculation as shown:

    SUM (UNITS ORDERED – UNITS SHIPPED)

    As an extra step, you'll need to configure the aggregation rule that will be used for this new Logical Column. Otherwise, the BI server is not going to be aware of the aggregation rule that is going to be applied.

  9. In the previous method, we could also use the wizard. It's easier to use it. You just have to right-click on the logical column that you want to make a calculation in and go to the Calculation Wizard menu item; it'll ask you the other values for calculations.

    At the end of the wizard you'll notice that the result is exactly the same as the first method, creating calculations based on logical columns, and the aggregation rule is going to be applied before the calculations.

How it works...

We learned how to create new calculations in this section and also covered how the aggregation rules are applied based on the columns. These calculation techniques may produce different results when it comes to the usage of multiplication or division.

There's more...

Although it's possible to add new calculation measures into the logical fact table easily, it's better to implement them in the data warehouse, because whenever a query is executed, these new measures are going to be calculated every time during runtime. This is going to negatively impact the query performance. The recommended way is implementing these measures at the database level and handling them in the Extraction, Transformation, and Loading (ETL) process. As a result, when the query is executed, the calculated values will be retrieved from the database itself instead of making any calculation during runtime. Adding new calculations to the business model should be a short-term solution. Obviously creating these calculated measures at the database level has a cost. Data warehouse design and the ETL process are all going to be affected, and it'll take some time to implement them.