Sie sind auf Seite 1von 31

Adding Calculations to a Fact

Copyright 2008, Oracle. All rights reserved.

Objectives
After completing this lesson, you should be able to:
Describe a calculation measure and its use in a business
model
Create new calculation measures based on logical columns
Create new calculation measures based on physical
columns
Create new calculation measures by using the Calculation
Wizard

7-2

Copyright 2008, Oracle. All rights reserved.

Business Problem
Businesses need to track the effectiveness of their
operations.
Businesses want to use businessrather than technical
language to ask business questions.
For example: Show me the accounts receivable balance as of
Q3.

Some information is derived from other data such as:


Derive money outstanding.

Compare amount billed with amount received.

Derive units backordered.

7-3

Compare units ordered with units shipped.

Copyright 2008, Oracle. All rights reserved.

Business Solution
Oracle BI Server provides utilities to create calculation
measures in the business model.
Use the Expression Builder to create new logical columns
with a calculation formula.
Use existing logical columns or physical columns as objects in
the formula.

Use the Calculation Wizard to create calculation measures


based on existing logical columns.
Add calculation measures to the Presentation layer so that
users can pose business questions in Answers by using
familiar terminology.

7-4

Copyright 2008, Oracle. All rights reserved.

ABC Example
ABC wants to create a calculated measure, Cuts, that tracks
the difference between units ordered and units shipped.

Implement a new
measure that
calculates Cuts.

7-5

Copyright 2008, Oracle. All rights reserved.

Implementation Methods
Calculation measures can be created using:
Existing logical columns as objects in a formula
Physical columns as objects in a formula
The Calculation Wizard to automate the process
The Calculation Wizard creates new measure columns that
compare two existing logical columns in a formula.

7-6

Copyright 2008, Oracle. All rights reserved.

Steps for Using Existing Logical Columns


1. Create a new logical column.
2. Specify logical columns as the source.
3. Build a formula.

7-7

Copyright 2008, Oracle. All rights reserved.

1. Create a New Logical Column


Right-click the fact table and select New Object > Logical
Column.

Enter the name for


the new column.

7-8

Copyright 2008, Oracle. All rights reserved.

2. Specify Logical Columns as the Source


Select the Use existing logical columns as the source check
box.

7-9

Copyright 2008, Oracle. All rights reserved.

3. Build a Formula
Open the Expression Builder and build the calculation formula
using existing logical columns.

Click the ellipsis button to


open the Expression Builder.
7 - 10

Copyright 2008, Oracle. All rights reserved.

Steps for Using Physical Columns


1.
2.
3.
4.

7 - 11

Create a new logical column.


Map the new column.
Build the formula.
Specify an aggregation rule.

Copyright 2008, Oracle. All rights reserved.

1. Create a New Logical Column


Right-click the fact table and select New Object > Logical
Column.
Enter the name for
the new column.

Deselect.

7 - 12

Copyright 2008, Oracle. All rights reserved.

2. Map the New Column


Use the Column Mapping tab of the Logical Table Source
dialog box to open the Expression Builder for the new column.

Show unmapped columns.

Click to open the Expression Builder.

7 - 13

Copyright 2008, Oracle. All rights reserved.

3. Build the Formula


Build the calculation formula using physical columns.

Column mapping

7 - 14

Copyright 2008, Oracle. All rights reserved.

4. Specify an Aggregation Rule


Click the Aggregation tab and set the aggregation rule for the
CutsP column.

Set the aggregation rule.


Double-click to open the properties dialog box.

7 - 15

Copyright 2008, Oracle. All rights reserved.

Steps for Using the Calculation Wizard


1.
2.
3.
4.
5.

7 - 16

Open the Calculation Wizard.


Choose the columns for comparison.
Select the calculations.
Confirm the calculation measures.
New calculation measures are added.

Copyright 2008, Oracle. All rights reserved.

1. Open the Calculation Wizard


Right-click a logical column that you want to use in the
calculation and select Calculation Wizard.

7 - 17

Copyright 2008, Oracle. All rights reserved.

2. Choose the Columns for Comparison

7 - 18

Copyright 2008, Oracle. All rights reserved.

3. Select the Calculations

7 - 19

Copyright 2008, Oracle. All rights reserved.

4. Confirm the Calculation Measures

7 - 20

Copyright 2008, Oracle. All rights reserved.

5. New Calculation Measures Are Added


New calculation measures are automatically added to the
business model.

7 - 21

Copyright 2008, Oracle. All rights reserved.

Add New Measures to the Presentation Layer


Add new calculation measures to the Presentation layer
regardless of the method used to create the measures.

7 - 22

Copyright 2008, Oracle. All rights reserved.

Examining a Query Using Physical Columns


Use physical columns for calculations that require an
aggregation rule to be applied after the calculation.

Query uses a calculation measure


based on physical columns.

SQL calculates difference between


Units Ordered and Units Shipped
and applies the aggregation rule
after the calculation.

7 - 23

Copyright 2008, Oracle. All rights reserved.

Example: Using Physical Columns


To calculate total revenue accurately, multiply the Unit Price
by the number of Units Sold for each row, and then apply
the SUM aggregation rule to the total.

7 - 24

Copyright 2008, Oracle. All rights reserved.

Examining a Query Using Logical Columns


Use logical columns for calculation formulas that require an
aggregation rule that is applied before the calculation.

Query uses a calculation measure


based on logical columns.

and then calculates


the difference.
SQL first applies
the aggregation
rules to the
columns

7 - 25

Copyright 2008, Oracle. All rights reserved.

Example: Using Logical Columns


To accurately calculate unit price, sum Total Price and
Units Sold first and then divide Total Price by Units
Sold to determine Unit Price.

7 - 26

Copyright 2008, Oracle. All rights reserved.

Examining a Query Using


the Calculation Wizard
The Calculation Wizard uses logical columns as objects in its
calculations, so aggregation rules are applied before the
calculation.
Query uses a calculation
measure built by the
wizard.

and then
calculates the
difference.

SQL first applies


the aggregation
rules to the
columns

7 - 27

Copyright 2008, Oracle. All rights reserved.

Summary
In this lesson, you should have learned how to:
Describe a calculation measure and its use in a business
model
Create new calculation measures based on existing logical
columns
Create new calculation measures based on physical
columns
Create new calculation measures by using the Calculation
Wizard

7 - 28

Copyright 2008, Oracle. All rights reserved.

Practice 7-1 Overview:


Creating Calculation Measures
by Using Logical Columns
This practice covers creating a calculation measure by using
existing logical columns.

7 - 29

Copyright 2008, Oracle. All rights reserved.

Practice 7-2 Overview:


Creating Calculation Measures
by Using Physical Columns
This practice covers creating a calculation measure by using
physical columns.

7 - 30

Copyright 2008, Oracle. All rights reserved.

Practice 7-3 Overview:


Creating Calculation Measures
by Using the Calculation Wizard
This practice covers creating a calculation measure by using
the Calculation Wizard.

7 - 31

Copyright 2008, Oracle. All rights reserved.

Das könnte Ihnen auch gefallen