You are on page 1of 31

<Insert Picture Here>

Make Oracle BI EE Smarter and Faster with Oracle OLAP


Cubes
Marty Gubar
Oracle BI/DW Product Management
Agenda

• Introduction
• OLAP Calculations
• Value of dimensional metadata
• Solution scales with calculation complexity
• Accessing calculations thru SQL
• Creating Oracle Business Intelligence EE metadata
• Analyzing OLAP cubes thru OBIEE Answers
Oracle OLAP 11g
Introduction

• Improve the delivery of information rich queries by


SQL-based business intelligence tools and
applications
– Simple definition of analytic calculations
– Simple access to analytic calculations
– Fast performance
– Leverage existing Oracle Database expertise
Oracle Database 11g
The Optimal Information Platform

Cohesive, integrated database


platform
Secure, highly available,
scalable and manageable
Rich analytic platform
Oracle Database 11g: Embedded OLAP
Simplify Heterogeneous Query Environments

Reporting MS Office Dashboard Web • Business rules in Oracle Database


& Analysis Service
– Single definition shared by all
client tools and applications
– Available in data dictionary
• Calculation complexity pushed into
analytic engine in the database
– Simplifies implementations
– Delivers efficient computation

5
Oracle Database Metadata
Table Relationships

REGION

CUST

SALES FACT

INVENTORY

ITEM

TIME
Column Relationships
Not Captured in Table’s Metadata

REGION

CUST
ITEM

SALES FACT item_key type_key cat_key

INVENTORY

ITEM

TIME
Value of Dimensional Metadata
Dimensions Formalize Data Relationships

Geography
REGION

CUST

SALES FACT Product

INVENTORY

ITEM
Time
TIME
Value of Dimensional Metadata
Dimensions Formalize Data Relationships

Geography
REGION
Product
Level-based Hierarchy
CUST Category

SALES FACT Product Type

Item
INVENTORY

ITEM Define the business


Time relationships
TIME
Value of Dimensional Metadata
Dimensions Formalize Data Relationships

Geography
REGION
Product
Complex Hierarchy
CUST

SALES FACT

INVENTORY

ITEM
Time
TIME
Model complex
hierarchical relationships
Value of Dimensional Metadata
Dimensions Formalize Data Relationships

Geography
REGION
Product
Hierarchical Relationships
CUST
Parent

SALES FACT Descendants


Children

INVENTORY

ITEM
Time
TIME
Use family references to
simplify calculations
Value of Dimensional Metadata
Time Dimension Supports Any Calendar Type

Geography
REGION

Sun Mon Tue Wed Thu Fri Sat


M
CUST A
1 2 3 4 5 6 7
R
SALES FACT
C 8 9 10 11 12 13 14
Product
H 15 16 17 18 19 20 21

22 23 24 25 26 27 28

INVENTORY
29 30 31 Fiscal Year End

ITEM Time dimension simplifies


Time time-series calculations
TIME
Value of Dimensional Metadata
Dimensions Shared Across Cubes

REGION Sales Cube

CUST
Product

SALES FACT
Geography
Time

INVENTORY

Inventory Cube
ITEM

Product
TIME
Time
Value of Dimensional Metadata
Aggregation Rules

REGION Sales Cube


∑ Aggregation Rules
CUST Product: Sum
Geography: Sum
Product
Time: Sum
SALES FACT
Geography
Time

INVENTORY

Inventory Cube
ITEM
∑ Aggregation Rules
Product: Sum
Product Time: Hierarchical Last
TIME
Time
Value of Dimensional Metadata
Analytic Calculations Leverage Metadata

REGION Sales Cube Calculations


• Sales
• YTD
CUST • YTD Growth
Product • Market Share
• Product Alert
SALES FACT
Geography • Moving Average
Time • …

INVENTORY

Inventory Cube
ITEM
Calculations
• Balance
Product • Inventory Cost
TIME • Stock Out
• …
Time
Characteristics of Analytic Calculations

OLAP calculations commonly include:


• Calculations over Time
– Period Ago, Year Ago, Year-to-Date, Moving Average
• Comparisons based on position in hierarchy
– Ratios, Share of Parent/Ancestor, Rank within Parent/Level
• References to a Dimension member
– Indexes
– Comparison to "top performer"
– Reference member at any aggregation level
• Forecasts
– Linear, Linear Regressions, Holt-Winters, “Best-fit”, etc.
• Models
– Series of equations used to compute values for dimension members
Calculation Glide-Path
Solution Scales with Calculation Complexity

• Calculation definition options support most any


analytic calculation requirements:
1. Calculation Templates
2. Calculation Expression Syntax
3. OLAP DML Programs, Functions and Models
Calculation Templates

Choose from a wide range of common business calculations


Calculation Expression Syntax

• OLAP Expression Syntax:


• Patterned after SQL analytic and window functions
• Extended to leverage unique properties of OLAP model
• Can leverage OLAP DML code
Calculation Expression Syntax
Similarity to Standard SQL Syntax

• Identical to SQL syntax for:


• Single Row Functions
• Approximately 90 single row functions are identical to SQL
• Examples: nvl, nullif, to_date, ||, replace, etc.
• Conditional Statements
• Supports standard comparative operators
• Examples: case, decode, <, <=, =, >, >=, !=, etc.
Calculation Expression Syntax
SQL Syntax Extended for OLAP Metadata

• Enables a single calculation to span various levels of


aggregation
• Leverages native understanding of hierarchical relationships
• Requires no densification for time-series calculations
• Includes the following functions:

AVERAGE_RANK HIER_PARENT MAX


AVG HIER_TOP MIN
COUNT LAG RANK
DENSE_RANK LAG_VARIANCE ROW_NUMBER
HIER_ANCESTOR LAG_VARIANCE_PERCENT SHARE
HIER_CHILD_COUNT LEAD SUM
HIER_DEPTH LEAD_VARIANCE
HIER_LEVEL LEAD_VARIANCE_PERCENT
Calculation Expression Syntax
Example of Extended SQL Syntax

Window function example (RANK)


• One OLAP Expression is equivalent to several SQL rank
expressions
--OLAP
- Rank within parent at any level
RANK() OVER HIERARCHY (PRODUCT.STANDARD ORDER BY SALES_CUBE.QUANTITY DESC NULLS
LAST WITHIN PARENT)

--SQL
--Rank departments
RANK() OVER (PARTITION BY total_product_id ORDER BY sales DESC NULLS LAST)
--Rank categories
RANK() OVER (PARTITION BY department_id ORDER BY sales DESC NULLS LAST)
--Rank types
RANK() OVER (PARTITION BY category_id ORDER BY sales DESC NULLS LAST)
--Rank sub types
RANK() OVER (PARTITION BY type_id ORDER BY sales DESC NULLS LAST)
-- Rank items
RANK() OVER (PARTITION BY sub_type_id ORDER BY sales DESC NULLS LAST)
Calculations Using OLAP DML

• OLAP DML is a dimensionally aware procedural programming


language
• Supports looping, conditional logic, multidimensional
selection and more
• Includes hundreds of analytic functions
• OLAP DML can be used:
• Within a custom measure expression
• To assign data to stored measures within a cube
• Forecasts
• Allocations
• Systems of expressions (a.k.a „models‟)
• Assignments based on user defined expressions
Calculations Using OLAP DML
Example: Forecast

“Scope the forecast


limit geography to geography_levelrel eq 'REGION'
limit product to product_levelrel eq 'TYPE'
limit channel to 'ALL_CHANNELS'
limit time to time_levelrel eq 'MONTH‘
"Set forecast parameters for 'best fit'
fcset _handle APPROACH 'APPAUTO' periodicity 12 histperiods 36
"Execute the best-fit forecast
FCEXEC _handle time time INTO forecast_best_fit -
seasonal forecast_seasonal -
smseasonal forecast_smseasonal backcast -
sales_cube_sales
Calculations Using OLAP DML
Example: Product Alert

“Look at product sales for the children of the current product


“Have they fallen compared to last year?
limit product to children using product_parentrel _product
limit product keep SALES_CUBE_SALES_PY_PCT_CHG lt 0

“If any products meet the criteria – return TRUE (an alert)
if statlen(product) gt 0
then return true
else return false
Cube Views
Automatically Synchronized with Cubes

Smart Search TIME

Web Analysis

SALES CUBE

Smart Space
GEOGRAPHY
Desktop Gadgets

SmartView INVENTORY CUBE

Custom Application
Hyperion
(SOAP, Visual
J2EE, .Net
Explorer
MDX, etc.) PRODUCT
Comparing "Star" Models

CUBE VIEWS TABLES


Geography_View Time_View Geographies Times

Sales_Cube_View Sales_Fact

Product_View Channel_View Products Channels

• Single cube view contains many • Fact table contains leaf data
summary levels

• Calculations exposed as • Calculations computed in


columns and computed in OLAP relational engine using functions
engine in select list
Generate OBIEE Metadata Over Cubes
AWM Plug-in Automates Process

Export cube metadata to


OBIEE Administrator
OBIEE Answers Leverages OLAP
Calculations Computed in OLAP Engine
Demonstrations

1. Create Calculations Using AWM


2. Query Cube Using SQL
3. Create an OBIEE Repository over Cubes
4. Query Cubes Using OBIEE Answers

Dem
o
For More Information

search.oracle.com

Oracle OLAP

Oracle Technology Network


For demonstrations, white papers, tutorials and more, visit:
http://www.oracle.com/technology/products/bi/olap/olap.html

You might also like