You are on page 1of 42

Working with Logical Dimensions

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Objectives
After completing this lesson, you should be able to: Create logical dimensions with level-based hierarchies Create logical dimensions with parent-child hierarchies Create level-based measures Create share measures Create calculated members

9-2

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Logical Dimensions
Introduce formal hierarchies into a business model Establish levels for data groupings and calculations Provide paths for drill down
Time dimension hierarchy

Levels Grand Total Years Quarters Months Days

9-3

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Logical Dimensions: Types


There are two types of logical dimensions: Dimensions with level-based hierarchies
Members of the same type occur only at a single level. Oracle BI Server supports unbalanced (ragged), skip-level, and time hierarchies.

Dimensions with parent-child hierarchies


All members have the same type (for example, an organizational reporting hierarchy).

9-4

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Level-Based Measures
Are columns whose values are calculated to a specific level of aggregation
Time dimension hierarchy

Levels Grand Total Years Quarters Months Days

Measures TotalRevenue YearRevenue QuarterRevenue MonthRevenue DayRevenue

9-5

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Share Measures
Are calculated by dividing a measure by a level-based measure to calculate a percentage

Time dimension at the Month level


$10,000 (Total sales for salesperson XYZ for January) $100,000 (Total sales for January) 10% (Share of sales attributable to salesperson XYZ)

9-6

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Logical Dimension: Example


This is an example of a Product logical dimension based on the Dim-Product logical dimension table.
Allows drill down in analyses Dimension

Level Column Levelbased measure

Measures are recalculated to the next level with drill down.

9-7

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

ABC Example
ABC wants to implement logical dimensions for Customer, Product, and Time.

9-8

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Creating a Level-Based Logical Dimension


1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Create a logical dimension object. Add a parent-level object. Add child-level objects. Specify level columns. Create level keys. Set the preferred drill path. Create level-based measures. Create additional level-based measures. Create share measures. Add measures to the Presentation layer. Create presentation hierarchies. Test measures and hierarchies.

9-9

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

1. Create a Logical Dimension Object


1. Right-click the business model. Select Logical Dimension > Dimension with Level-Based Hierarchy.

2. Name the logical dimension.

3. Logical dimension is added to business model.

9 - 10

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

2. Add a Parent-Level Object


Create the highest level of the hierarchy first.
Right-click the logical dimension and select Logical Level.

Name

Select to indicate highest level.

9 - 11

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

3. Add Child-Level Objects


Add subsequent levels in the hierarchy.

1. Right-click the level and select New Object > Child Level.

2. Name the level.

3. Repeat to create remaining levels.

9 - 12

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

4. Specify Level Columns


Associate logical columns with logical levels in the hierarchy.
Drag logical columns from the logical table to the levels in the hierarchy to associate the columns with the levels.

The logical column is associated with the logical level in the logical dimension.

9 - 13

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

5. Create Level Keys


Level keys define the unique elements in each level and provide the context for drill down.

Month key is set to be displayed for drill down.

9 - 14

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

6. Set the Preferred Drill Path


Use Preferred Drill Path to specify a drill path outside the normal drill path defined by the dimension-level hierarchy.
1. Click Add. 3. Level is added.

2. Select logical level from current or other dimensions.

9 - 15

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

7. Create Level-Based Measures


Example: Create a level-based measure for a Grand Total level that refers to an existing logical fact column.
1. Create a new logical column.

3. Select level.

4. Measure is added to dimension. 2. Build formula. 5. Column is added to fact table.

9 - 16

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

8. Create Additional Level-Based Measures


Create other level-based measures to make measures from various levels available simultaneously in queries.
1. Create a new logical column.

3. Select level.

4. Measure is added to dimension.

2. Build formula.

5. Column is added to fact table.

9 - 17

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

9. Create Share Measures


Create a new logical fact column that calculates the share by dividing the appropriate measure by a total measure.

Show how sales of a specific product compare to the overall sales for all products.

9 - 18

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

10. Add Measures to the Presentation Layer


Add new measures to the Presentation layer so that they can be used in queries.

9 - 19

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

11. Create Presentation Hierarchies


To create a presentation hierarchy, drag a logical dimension hierarchy from the BMM layer to a table in the Presentation layer.

Drag logical dimension hierarchies from BMM layer to Presentation layer.

Users can create hierarchy-based queries.

9 - 20

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

12. Test Measures and Hierarchies


Run analyses to test results. Drill down to check relative recalculations.

Drill down for details. Dollars and Product Share are recalculated with drill down.

9 - 21

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Parent-Child Logical Dimensions


A parent-child logical dimension is a hierarchy of members that all have the same type. This contrasts with level-based hierarchies, in which members of the same type occur only at a single level of the hierarchy. The most common real-world example of a parent-child hierarchy is an organizational reporting hierarchy chart, in which the following all apply:
Each individual in the organization is an employee. Each employee, apart from the top-level managers, reports to a single manager. The reporting hierarchy has many levels.

9 - 22

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Parent-Child Hierarchy: Example


This chart provides a simple example of a multilevel parent-child hierarchy.

9 - 23

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Parent-Child Logical Table


A parent-child hierarchy is typically based on a single logical table (for example, the Employees table). Each row in the table contains two identifying keys: one to identify the member itself and the other to identify the "parent" of the member.
Member Parent

9 - 24

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Parent-Child Relationship Table


For each Oracle BI Server parent-child hierarchy defined on a relational table, you must explicitly define the intermember relationships in a separate parent-child relationship table.
Member Ancestor Distance Leaf

9 - 25

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Creating a Parent-Child Logical Dimension


1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.
9 - 26

Create a logical dimension object. Set the member key. Set the parent column. Open the Parent-Child Relationship Table Settings dialog box. Enter parent-child relationship table script information. Enter parent-child relationship table details. Preview scripts. Confirm parent-child relationship table settings. Confirm changes to the BMM layer. Confirm changes to the Physical layer. Modify the Physical layer. Modify the BMM layer. Create the presentation hierarchy. Test your work.
Copyright 2012, Oracle and/or its affiliates. All rights reserved.

1. Create a Logical Dimension Object


Do either of the following: Right-click the business model object and select New Object > Logical Dimension > Dimension with Parent-Child Hierarchy. Right-click the logical dimension table and select Create Logical Dimension > Dimension with Parent-Child Hierarchy.

Name the logical dimension.

9 - 27

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

2. Set the Member Key


Click Browse next to the Member Key field to view or set the member key.

Click View to view or change the key column.

9 - 28

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

3. Set the Parent Column


Click Browse next to the Parent Column field to set the parent column.

9 - 29

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

4. Open the Parent-Child Relationship Table Settings Dialog Box


Click the Parent-Child Settings button to open the Parent-Child Relationship Table Settings dialog box.

Parent-child relationship table is not yet defined.

Click to start the wizard.

Parent-child relationship table columns are not yet defined.

9 - 30

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

5. Enter Parent-Child Relationship Table Script Information


In the Script Location screen, enter names and locations for the DDL scripts to create and populate the parent-child relationship table.

Name and location of DDL script used to create parent-child relationship table

Name and location of DDL script used to populate parent-child relationship table

9 - 31

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

6. Enter Parent-Child Relationship Table Details


In the Parent-Child Relationship Table Details screen, provide details for the table that is generated by the scripts.

Enter a name for the parent-child relationship table. Browse to (or accept the defaults for) the physical location and logical associations.

9 - 32

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

7. Preview Scripts
In the Preview Script screen, click View Script to view either or both of the scripts.

Script to create parent-child relationship table

Script to populate parent-child relationship table

Click Finish to close the wizard.

9 - 33

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

8. Confirm Parent-Child Relationship Table Settings


When the wizard completes, the Parent-Child Relationship Table details are populated.

Parent-child relationship table is now defined for the logical table source.

Parent-child relationship table column details have been populated automatically.

9 - 34

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

9. Confirm Changes to the BMM Layer


When the wizard completes, the parent-child logical dimension is added to the BMM layer.

9 - 35

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

10. Confirm Changes to the Physical Layer


When the wizard completes, the parent-child relationship table is added to the Physical layer.

9 - 36

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

11. Modify the Physical Layer


After adding the parent-child relationship table to the Physical layer, you must make modifications (such as creating aliases and joins).

9 - 37

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

12. Modify the BMM Layer


Map the logical table source in the business model to the parent-child relationship table in the Physical layer.

9 - 38

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

13. Create the Presentation Hierarchy


Add the hierarchy to the corresponding table in the Presentation layer to make the hierarchy available for queries.

9 - 39

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

14. Verify Your Work


Add the hierarchy to an analysis and check the results.

Measure rolls up through each level of the hierarchy.

9 - 40

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Calculated Members
Are user-defined dimension members whose measure values are calculated at run time Are defined within a dimension through a formula that references other members of the same dimension Can be defined for a single dimension or across multiple dimensions Presentation hierarchy Calculated member name
Formula

Result

9 - 41

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Summary
In this lesson, you should have learned how to: Create logical dimensions with level-based hierarchies Create logical dimensions with parent-child hierarchies Create level-based measures Create share measures Create calculated members

9 - 42

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

You might also like