You are on page 1of 252

Oracle Database 10g: Using OLAP

Electronic Presentation

D17505GC20
Edition 2.0
April 2006
D45766
®
Authors Copyright © 2006, Oracle. All rights reserved.

Brian Pottle Disclaimer

Kevin Lancaster This document contains proprietary information and is protected by copyright and other intellectual
Nancy Greenberg property laws. You may copy and print this document solely for your own use in an Oracle training
course. The document may not be modified or altered in any way. Except where your use constitutes
"fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
Technical Contributors perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part
and Reviewers without the express authorization of Oracle.

Stuart Bunby The information contained in this document is subject to change without notice. If you find any
Marty Gubar problems in the document,
document please report them in writing to: Oracle University,
University 500 Oracle Parkway
Parkway,
Redwood Shores, California 94065 USA. This document is not warranted to be error-free.
Sharath Bhujani Restricted Rights Notice
Laszlo Czinkoczki
Laura Garza If this documentation is delivered to the United States Government or anyone using the
Sue Helmy documentation on behalf of the United States Government, the following notice is applicable:
Keith Laker U.S.
U S GOVERNMENT RIGHTS
Miguelangel Lopez The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these
Timothy McGlue training materials are restricted by the terms of the applicable Oracle license agreement and/or the
Srinivas Putrevu applicable U.S. Government contract.
Kasturi Shekhar Trademark Notice
Anthony Waite
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or
Publisher its affiliates
affiliates. Other names may be trademarks of their respective owners
owners.

Jobi Varghese
Editors
Navratan Singh
Richard Wallis
Graphic Specialist
Sanjeev Sharma
Oracle Database 10g:
Using OLAP

Student Guide

D17505GC20
Production 2.0
April 2006
D45765

®
Authors Copyright © 2006, Oracle. All rights reserved.

Brian Pottle Disclaimer


Kevin Lancaster This document contains proprietary y information and is protected by
y copyright
y g and
N
Nancy G
Greenberg
b other intellectual property laws. You may copy and print this document solely for your
own use in an Oracle training course. The document may not be modified or altered
in any way. Except where your use constitutes "fair use" under copyright law, you
Technical Contributors may not use, share, download, upload, copy, print, display, perform, reproduce,
and Reviewers publish, license, post, transmit, or distribute this document in whole or in part without
the express authorization of Oracle.
Stuart Bunby
Marty Gubar The information contained in this document is subject to change without notice. If you
find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Sharath Bhujani warranted
t d to
t be
b error-free.
f
Laszlo Czinkoczki
Laura Garza Restricted Rights Notice
Sue Helmy
If this documentation is delivered to the United States Government or anyone using
Keith Laker the documentation on behalf of the United States Government, the following notice is
Miguelangel Lopez applicable:
Timothy McGlue
Srinivas Putrevu U.S. GOVERNMENT RIGHTS
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
Kasturi Shekhar disclose these training materials are restricted by the terms of the applicable Oracle
Anthony Waite license agreement and/or the applicable U.S. Government contract.

Publisher Trademark Notice

Jobi Varghese Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle
Corporation and/or its affiliates. Other names may be trademarks of their respective
Editors owners.

Navratan Singh
Richard Wallis
Graphic Specialist
Sanjeev Sharma
Course Objectives
In this course, you learn how to use the features of online analytical processing (OLAP) to derive
critical information from multidimensional data that is stored in Oracle Database 10g. This
includes learning OLAP concepts, building a cube with the Oracle Database 10g Analytic
Workspace Manager (AWM 10g) toolkit, enhancing analytic content, and using tools for OLAP
analysis.

Oracle Database 10g: Using OLAP I-2


Course Agenda
On day 1 of the course, you concentrate on learning the Oracle OLAP technology, terminology,
and concepts.
p By y the end of dayy 1, yyou will have built an analytic
y workspace
p ((AW)) with cubes
and dimensionality.
On day 2, you use OracleBI Spreadsheet Add-In (in Excel) and the Discoverer Plus OLAP tool to
view the objects in the AW. You create and view calculated measures and build exception and
ranking reports. The final lesson introduces you to the strengths of the OLAP DML (data
manipulation language).

Oracle Database 10g: Using OLAP I-3


Tables Used in This Course
The sample company portrayed by the Oracle database sample schemas operates worldwide to
fill orders for several different pproducts. The company
p y has several divisions:
• The Human Resources (HR) division tracks information about the company’s employees
and facilities.
• The Order Entry division tracks product inventories and sales of the company’s products
through various channels.
• The Sales History (SH) division tracks business statistics to facilitate business decisions.
Each of these divisions is represented by a schema.
This course primarily uses the Sales History (SH) sample schema. All scripts necessary to
create the SH schema reside in the following folder:
$ORACLE_HOME/demo/schema/sales_history

Oracle Database 10g: Using OLAP I-4


Sales History (SH) Schema
The sample company does a high volume of business, so it runs business statistics reports to aid
pp
in decision support. Many y of these reports
p are time-based and nonvolatile. That is, theyy analyze
y
past data trends. The company loads data into its data warehouse regularly to gather statistics for
these reports, among which are annual, quarterly, monthly, and weekly sales figures by product.
The company also runs reports about distribution channels through which its sales are delivered.
When the company runs special promotions on its products, it analyzes the impact of those
promotions on sales. It also analyzes sales by geographical area.
Note: Additional information about the SH schema is available in Appendix B, “Table
Descriptions and Data.”

Oracle Database 10g: Using OLAP I-5


Oracle Database 10g: Using OLAP I-6
Objectives
In this lesson, you learn about the Oracle Database 10g OLAP (online analytical processing)
option
p and dimensional model that is implemented
p in Oracle Database 10g. The ggoal of this
lesson is to describe the fundamental concepts of OLAP and the reasons why organizations use
it.
In addition, you learn the definitions of dimensional data model elements, such as measures,
dimensions, hierarchies, levels, and attributes, in Oracle OLAP.

Oracle Database 10g: Using OLAP 1-2


What Is OLAP?
Online analytical processing (OLAP) is a term that has been used since the early 1990s to
describe a class of computer
p systems
y that are designed
g and optimized
p for analysis.
y Byy using
g this
term, you can differentiate the requirements of the data analyst from the requirements of the
users of online transaction processing (OLTP). In the context of business intelligence today, the
emphasis is more on “online” and “analytical.”
Online: Although most OLAP tools and applications enable development of reports that can be
saved and printed when not connected to live data, OLAP emphasizes live access to data rather
than static reporting. Analytic queries are submitted against the database in real time, and the
results
l are returnedd to your computer screen.
Analytical processing: This is the key concept with OLAP. End users can:
• Easily navigate multidimensional data to perform unpredictable ad hoc queries and to
display the results in a variety of interesting layouts
• Drill through levels of detail to uncover significant aspects of data
• Rapidly and efficiently obtain the results of sophisticated data calculation and selection
across multiple dimensions of data

Oracle Database 10g: Using OLAP 1-3


Typical Business Questions
A standard transactional report or query might ask, “When did order 84305 ship?” This
query
q y reflects the basic mechanics of doing
g business. It involves simple
p data selection
and little or no calculation processing.
In contrast, OLAP systems are typically deployed to extend and enhance an
organization’s ability to answer a much broader range of business questions about the
data (examples of which are presented in the slide). These questions are more
analytical and complex, and the answer to one question often leads immediately to
another question as the user follows a train of thought in researching a business
problem
bl or opportunity.
t it
OLAP is designed to make it easy for end users to ask these types of analytical
questions without requiring:
• Assistance from information technology (IT)
• Programming skills
• Technical knowledge about the organization of the database
The results
Th lt off queries
i also
l need d to
t be
b rapid
id so that
th t the
th analyst’s
l t’ ttrain
i off th
thought
ht iis nott
interrupted and the value of the analysis is not diminished.

Oracle Database 10g: Using OLAP 1-4


Examining an OLAP Question
The questions that business users tend to ask are naturally multidimensional. They use a
multidimensional language
g g to ask business qquestions ((such as the one shown in the slide).)
OLAP Questions Are Multidimensional Queries
The OLAP question shown in the slide is a common example of a multidimensional query.
It describes both the data that the user wants to examine and the structural form of that data.
Business users typically want to answer questions that include terms such as what, where, who,
and when.
For example, you find the following essential questions embedded in the sample question:
• What products are selling best? (“…top 20%…”)
• Where are they selling? (“…each region of the world…”)
• When have they performed the best? (“…percentage change in revenue…”)

Oracle Database 10g: Using OLAP 1-5


Examining an OLAP Question (continued)
A Simple Business Question but a Complex Query
However, there is much more that is contained in this query:
• There
Th are two t calculations
l l ti (percentage
( t change
h in
i revenue andd rolling
lli three-month
th th total).
t t l)
• There is a ranking element (the top 20% of products).
• There are aggregations (region level of the geography dimension).
• There are multidimensional selections (specific products, specific time periods, and
specific regions).
• The result of the query is a multidimensional view of the data (perhaps as a tabular display
on the screen, pperhaps
p as a ggraph,
p or both).)
Many would categorize that as quite a complex query. And, for many traditional query and
reporting tools and databases, it indeed is quite complex. But the complexity of this query is a
technical issue rather than a business issue.
Therefore, a key goal of OLAP technology is to make it very easy for end users to ask such
questions about their data without placing a burden on the IT department.
How Does OLAP Make This Easy?
Business users think dimensionally. By design, OLAP technology stores, processes, and presents
data in a dimensional way.
• The data model of OLAP systems reflects the users’ picture of their business data, making
it easy to formulate queries in business terms.
• OLAP systems are optimised for fast retrieval of data for dimensional analysis.
We will now examine the multidimensional logicalg model,, which serves as the basis for OLAP
systems.

Oracle Database 10g: Using OLAP 1-6


Dimensional Model
In this section, you learn the components of the dimensional model, which essentially
comprises measures and dimensions.

Oracle Database 10g: Using OLAP 1-7


Measures
Measures represent factual data; they are sometimes called “facts.” Typical examples of
measures are sales, cost, pprofit, and margin.
g
Measures are organized by one or more dimensions. The image in the slide represents a generic
measure that is organized by three dimensions. Many people visualize measures as being of a
multidimensional shape, such as a cube, in which the edges of the shape are the dimensions and
the contents of the shape are the measure values.
Visualizing Measures
There is a tendency to draw three
three-dimensional
dimensional (3D) shapes and refer to “cubes”
cubes (which are 3D)
simply because they are easy to visualize. Of course, measures in a dimensional model can have
1, 2, 3, 4, 5, 6, 7 or many more dimensions.
Most measures in OLAP systems tend to be numeric, although some products, such as Oracle
OLAP, support measures in a wide variety of different data formats, including date, Boolean
(Y/N), and text.

Oracle Database 10g: Using OLAP 1-8


Measure Types
Measures may be stored or calculated at query time.
Stored
Sto ed Measures
easu es
Stored measures are loaded and stored in the database, or are the results of
calculations that are stored.
Calculated Measures
Calculated measures are measures whose values are calculated dynamically at query
time. Only the calculation rules are stored in the database.
Common calculations include measures such as ratiosratios, differences
differences, moving totals
totals, and
averages. Calculations do not require disk storage space, and they do not extend the
processing time required for data maintenance.
Note: Oracle OLAP has a library of several hundred multidimensional calculation
functions that can be used in calculated measures. It is even possible for expert users of
Oracle OLAP to define their own functions to perform virtually any calculation.

Oracle Database 10g: Using OLAP 1-9


Example of Measures in a Report
In the example, the report includes a crosstab that contains four measures:
• Revenue
• Costs
• PROFIT
• Margin %
In this example, Revenue and Costs are stored measures, and PROFIT and Margin % are
calculated measures.
Stored and Calculated Measures Are the Same to the End User
All measures are equivalent as far as the end-user interface is concerned. They appear
in the same way, and all are available with consistently fast query performance, even if
there is significant aggregation and calculation going on to arrive at the display
requested.

Oracle Database 10g: Using OLAP 1-10


Dimensions
Dimensions identify and categorize your measure data. They shape measures by forming the
edges
g of the measures.
Examples of dimensions include product, geography, time, and distribution channel.

Oracle Database 10g: Using OLAP 1-11


Example of Dimensions in a Report
In this example, the report includes the same crosstab shown previously in the section titled
“Examplep of Measures in a Report.”
p The four measures are organized
g byy the followingg
dimensions:
• Product (displayed on the row axis)
• Time
• Customer
• Channel
Each of the dimensions may be placed on any axis in the report, including the column axis,
where
h the h measures are currentlyl displayed.
di l d Dimensions
Di i may also
l beb nestedd on any axis.
i
In the example, the Product dimension is displayed on the row axis. The other dimensions are all
displayed in the Page Items area. In an OLAP report, you can choose any of the dimension
members that have been selected for each dimension in the query.

Oracle Database 10g: Using OLAP 1-12


Sharing Dimensions
One of the characteristics of the dimensional model is that the dimensions and their members are
shared byy all measures, of whatever shape.
p In the examplep in the slide, there are three measures.
Sales and Units have the same shape; they are both dimensioned by the Customer, Product, and
Time dimensions. The Price measure is dimensioned by Product and Time only; it does not use
the Customer dimension because, in this example, the price does not vary by customer.
Therefore, the Customer dimension is not used by the Price measure.
Dimensions are stored once and are used repeatedly. That is, there is just one Time dimension in
this example, even though it appears three times in the diagram.

Oracle Database 10g: Using OLAP 1-13


Hierarchy
Dimension hierarchies are optional but are common in OLAP systems. A hierarchy is a logical
structure that ggroups
p like members of a dimension together
g for the ppurpose
p of analysis.
y
For example:
• A Time dimension might have a hierarchy that describes how months are grouped together
to represent a quarter and how quarters are grouped together to represent a full year.
• An Organization dimension might have a hierarchy that makes it easy for you to identify
the direct reports of a specific manager.
Each dimension can have multiple hierarchies if required. For example, the time dimension can
have a hierarchy that represents the Julian calendar and another hierarchy that represents a fiscal
calendar.

Oracle Database 10g: Using OLAP 1-14


Hierarchy (continued)
A dimension’s structure is organized hierarchically based on parent-child relationships. These
relationships enable:
• Navigation between levels: Hierarchies on dimensions enable drilling down to lower
levels or navigating (rolling up) to higher levels. Drilling down on the Time dimension
member “2005” will likely navigate you to the quarters Q1 2005 through Q4 2005. In a
calendar year hierarchy, drilling down on Q1 2005 would navigate you to the months
January 05 through March 05. These kinds of relationships make it easy for users to
navigate large volumes of multidimensional data.
• Aggregation from child values to parent values: The parent represents the aggregation of
its children. Data values at lower levels aggregate into data values at higher levels.
Dimensions are structured hierarchically so that data at different levels of aggregation can
be manipulated together efficiently for analysis and display. You learn about the
aggregation capabilities of Oracle OLAP in the lesson titled “Applying Advanced
Dimensional Design and Cube Processing Techniques.”
• Allocation from parent values to child values: The reverse of aggregation is allocation
and is heavily used by planning, budgeting, and similar applications. Here, the role of the
hierarchy is to identify the children and descendants of particular dimension members for
“top-down” allocation of budgets (among other uses).
• Grouping of members for calculations: Share and index calculations take advantage of
hierarchical relationships (for example, the percentage of total profit contributed by each
product, or the percentage share of product revenue for a certain category, or costs as a
percentage of the geographical region for a retail location).

Oracle Database 10g: Using OLAP 1-15


Hierarchy: Example
In this example, you can do the following in the Product hierarchy:
• Navigate
g upp through g each level in the hierarchy
y from the lowest level to the highest
g level
• Navigate down the hierarchy from the highest level to the lowest level
• Aggregate data from the lowest level (individual products) up through the hierarchy to the
highest level (total product)

Oracle Database 10g: Using OLAP 1-16


Level
Each level represents a position in the hierarchy. The level above the base level contains
aggregate
gg g values for the levels below it. The members at different levels have a one-to-manyy
parent-child relationship. A hierarchy typically contains several levels, and a single level can be
included in more than one hierarchy.
If data for the Sales measure is stored at the Product level, then the higher levels of the product
dimension enable the sales data to be aggregated correctly into Subcategory, Category, and All
Products levels.
If there are multiple hierarchies built over a dimension, it may be that a level would
appear in more than one hierarchy or may exist in only one hierarchy.

Oracle Database 10g: Using OLAP 1-17


Types of Hierarchy
Level Based
Most of the hierarchies are level based
based, including the Product dimension hierarchy shown in the
previous slide and the Time dimension hierarchy shown in this slide. In the time hierarchy
example, there are Day, Month, Quarter, and Year levels in the hierarchy.
Sales forces also generally have a level-based structure, as in the following example:
Representative > Area > Region > Country > Continent > World
Value Based
Other dimensions may have hierarchies that are not strictly level based. For example,
there is clearly a hierarchy in an organization chart, but all the direct reports of the President may
not be at the same level. In the example, the two VPs (vice presidents) and the President’s Admin
(administrative assistant) are all direct reports of the President but are not at the same level. The
VPs are not at the Admin level, and the Admin is not at the VP level.

Oracle Database 10g: Using OLAP 1-18


Attributes
Dimensions may also have attributes, which are used to provide more information about
members of the dimension.
Description
Unless dimension-member IDs themselves are meaningful to end users, it is usually the
case that each dimension has “description” attributes that store the user-visible
identifiers for the dimension members.
Data Selection
Attributes are also useful when filtering that dimension for analysis
analysis. They can be used
for data selection purposes. These kind of attributes are entirely optional. Oracle OLAP
permits a large number of attributes to be created if required.
How Are Attributes Applied?
Some attributes are valid for all the members of the dimension, regardless of level. For
example, all products at all levels have a description.
Others attributes
Oth tt ib t are valid
lid ffor certain
t i levels
l l or certain
t i hi
hierarchies
hi only.
l F For example,
l only
l
individual product items have a color.

Oracle Database 10g: Using OLAP 1-19


Attributes and Levels: Examples
In the chart in the slide, certain products are displayed together with their parent levels
in the hierarchyy (subcategories
( g and categories)
g ) on the Product dimension. In addition,
two sample attributes (Color and Product Manager) are displayed for these products.
Other examples of typical attributes might include:
• For Product dimensions: Color, Flavor, Pack Size, Brand Manager Name, and so on
• For Customer dimensions: Gender, Marital Status, Date of Birth, and other types
of demographic information
Note: Sometimes, attributes may also be modeled as levels in an alternate hierarchy. Consider
the example in the slide. If the business requirement was that measures should be aggregated by
Product Manager (total for Bruce, John, Karl, Mary, and so on.) or by Color (total for Blue,
Green, Red, White, Yellow, and so on) and by the ability to drill down, aggregate, allocate, or
calculate data based on these values, then many designers would consider creating additional
hierarchies on the Product dimension for this purpose. However, many attributes have little
business use as aggregates and are used simply in filtering.

Oracle Database 10g: Using OLAP 1-20


Dimensional Model Summarized
In summary, the dimensional model is essentially made up of measures and dimensions.
Measures contain or calculate data, and dimensions organize data.
Dimensions are mandatory in a dimensional model—if you do not have dimensions, you
cannot have measures. Dimensions are what describe measures: they are fundamental
to dimensional analysis.
Dimensions may contain the following elements:
• Dimensions optionally have hierarchies, which are logical structures that group like
members of a dimension together for the purposes of analysis, aggregation, or allocation.
• Hierarchies may or may not have levels, because some hierarchies are not level
based.
• Dimensions may also have attributes, which are used to provide more information
about members of the dimension. Attributes are useful when filtering that dimension
for analysis.

Oracle Database 10g: Using OLAP 1-21


OLAP: A Historical Perspective
Historically, multidimensional technology has been compelling because business users think
dimensionally,y and multidimensional technology gy ppresents data in a wayy that reflects the user’s
picture of their business data. However, organizations have always been forced to make choices,
driven by technical and architectural needs, when considering how best to deliver the logical
dimensional model to end users.
• Deploy a stand-alone multidimensional database. For many years, the most common
solution was to purchase and deploy a separate specialized multidimensional
database that is tuned for the dimensional model, and transfer data to it from the
source systems (most of which are running on relational database management
systems or flat file legacy systems).
• Implement a dimensional schema in an RDBMS. Other organisations, while recognising
that specialized multidimensional OLAP servers had certain advantages, would prefer to
standardize on their relational database of choice, and deliver the dimensional model via a
star or snowflake schema.
Advantagesg and Disadvantages g
In the next few sections some of the advantages and disadvantages of these different approaches
are considered.

Oracle Database 10g: Using OLAP 1-22


Deploy a Stand-alone Multidimensional Database
Benefits
Multidimensional databases physically implement the dimensional model with
multidimensional data types. The specialized storage model is optimized for:
• Fast storage and retrieval of multidimensional data
• Ease of definition and efficiency of analytical calculations
• Efficient computation and increased speed of operations for calculations,
aggregations, and allocations
• Natural conformance to the logical dimensional model favored by business people
Drawbacks
• The extra cost of deploying, managing, and securing a separate stand-alone, proprietary
database engine, and the information latency resulting from the requirement of transferring
the data to it
• The increased learning curve for IT and business users who require different tools using
proprietary APIs to access multidimensional data
• Stand-alone multidimensional OLAP servers could not be used for some business
requirements for reasons of scalability. The best relational databases had much greater
ability to handle the storage of large volumes of data.

Oracle Database 10g: Using OLAP 1-23


Implement a Dimensional Schema in an RDBMS
Benefits
• IT does not incur the costs associated with deploying
p y g a separate,
p proprietary
p p y system.
y
• Database administrators (DBAs) continue to use their relational skills and tools, and can
manage all their business intelligence data in the familiar scalable RDBMS
• Because all data was in the RDBMS, organizations had a wide choice of SQL-based access
tools, and the same SQL tool could access all the data.
• It was typically much easier to physically store large volumes of data relationally than was
possible in multidimensional databases.
Drawbacks
D b k
• As the business requirement resulted in queries that were more ad hoc, less predictable, and
more calculation intensive (more calculations and/or more complex calculations), query
performance typically declined dramatically.
• It was difficult, and sometimes impossible, to implement the required business calculations
required by OLAP applications with SQL on relational tables. It certainly became too
complex
p for business users to define the calculations and qqueries theyy needed for their
analysis.

Oracle Database 10g: Using OLAP 1-24


A Compromising Choice
Because of the benefits of the multidimensional physical implementation of the dimensional
model, and despite
p the known drawbacks of this approach,
pp manyy organizations
g (even
( those with
skills and investment in leading RDBMS databases such as Oracle Database) invested in separate
multidimensional databases, such as Oracle Express Server, to deliver high performance OLAP
systems. In their judgement, the extra cost and inconvenience of using these separate
technologies was worth in return for their ability to better deliver their end users’ business
requirements.
There was no one solution that met the business intelligence needs of all organizations.

Oracle Database 10g: Using OLAP 1-25


Handling Multidimensional Needs with Oracle OLAP 10g
With Oracle OLAP 10g, these choices and compromises are no longer necessary. Oracle OLAP
uniquely
q y combines relational and multidimensional database technology gy into a single
g database:
Oracle Database 10g.
Oracle’s objective in developing Oracle OLAP 10g was to continue to offer not only the leading
relational platform for business intelligence, but to incorporate highly advanced and powerful
multidimensional technology inside the Oracle database, where it could be managed, secured,
and accessed just like other data in the database. This has removed most, if not all, of the
fundamental drawbacks of using multidimensional database technology in the past.
With the Oracle OLAP option, you also benefit from the following:
• There is no need to copy and transfer data into separate specialised databases.
• All data is in one place.
• All business and calculation rules are defined and stored in one place.
• Data is secured and managed by the Oracle database.
• OLAP systems, including those based on multidimensional data types, benefit from the
scalability and availability features of the Oracle database.
database
• All data, relational and multidimensional, can be queried with regular SQL.

Oracle Database 10g: Using OLAP 1-26


Handling Multidimensional Needs with Oracle OLAP 10g (continued)
Access Options
The OLAP option to the Oracle database provides a sophisticated OLAP API that is used by
b i
business intelligence
i t lli ttools
l th
thatt are aware off th
the di
dimensional
i l model.
d l Thi
This OLAP API can be b usedd
to query both multidimensional data types and dimensional models that are implemented in a
relational star or snowflake style of schema.
Likewise, with Oracle Database 10g, users and tools can query data with regular SQL—not only
the relational data types, but also the multidimensional data types and calculation engine.
Therefore, with Oracle OLAP, your choice of tool is not driven by your choice of database, and
your choice of architecture does not result in your having to choose between separate databases
or separate end-user tools with different capabilities and strengths. The same data, whether
stored in a star or snowflake schema or in multidimensional form in the database, can be
accessed by any tool that can query the database with SQL or via the OLAP API.
This means that there is no need to duplicate data in multiple databases in order for different
tools to use the data, thus reducing costs and improving the quality and consistency of reporting
and analysis alike.
Which Data Types and When?
For business intelligence applications that are simple, with fixed or very predictable reporting
patterns and simple calculations, the multidimensional data types of the OLAP option might not
be required.
If, however, the system must support sophisticated calculations and excellent query performance
in an unpredictable query environment
environment, the performance benefits of the OLAP option can be
significant.
Because the disadvantages of separate multidimensional databases are eliminated, and because
the performance and calculation characteristics of the best multidimensional databases are
preserved and extended within the Oracle database, many organisations are choosing to
implement multidimensional OLAP inside Oracle Database 10g.

Oracle Database 10g: Using OLAP 1-27


Query Performance
Oracle multidimensional data types are designed to support the dimensional model with
excellent qqueryy pperformance and efficient data loading,
g aggregation,
gg g and calculations. The
performance benefits increase as the calculations become more complex and numerous, and as
the usage of the data set becomes more ad hoc. Query performance is generally fast, and
consistently fast, as a result of a number of characteristics of the multidimensional data types in
the database.
More Information
For details about query performance characteristics and performance tests carried out with
Oracle OLAP, see the white paper at:
http://www.oracle.com/technology/products/bi/olap/1450_olap10g_enhance_content_performan
ce.pdf

Oracle Database 10g: Using OLAP 1-28


Time to Prepare Data for Query
Although multidimensional data types provide fast query performance, especially for
multidimensional calculations, it is also true that, to a large
g extent, careful tuningg of the
relational implementation (through the use of partitioning and parallelism, pre-materialization of
calculated data, creating many indices, fine-tuning highly optimized SQL, and using middle-tier
caching strategies, and so on) can provide impressive query performance from star and
snowflake schemas. However, these techniques require additional data preparation time—ETL
(extract, transform, load) processing is required before data is ready for users to analyze.
The amount of time required to prepare data for query is important, because it is a controlling
f
factor i determining
in d i i theh practical
i l size
i off a data
d set andd the h frequency
f off updates.
d This
Thi graphh
describes the relationship between the data preparation time needed to achieve acceptable query
performance and the ad hoc and calculation intensity of the application.
The graph indicates that there is a higher minimal data preparation cost associated with the use
of multidimensional data types. However, after data has been prepared for query, it can service
the more demanding ad hoc applications without additional preparation. With a purely relational
approach the cost of preparation can become significant,
approach, significant even for applications of moderate
complexity.

Oracle Database 10g: Using OLAP 1-29


Oracle Database 10g: Using OLAP 1-30
Practice 1: Overview
In this practice, you review a requirements definition for a business intelligence system. From
this definition, yyou design
g a logical
g multidimensional model.

Oracle Database 10g: Using OLAP 1-31


Practice 1
Requirements Definition Narrative
Bruce works as a business analyst at XYZ Stores—a popular clothing retail chain specializing in
fashionable attire for professional men and women and their children.
children
XYZ stocks and sells both formal and casual wear out of 68 stores across the United States and
Canada, and also in major countries in Europe. The company has recently expanded into the Asia
Pacific region, opening stores in Melbourne, Australia, and in a shopping mall in Singapore.
Bruce wants to build a business intelligence (BI) system to replace all of the Excel spreadsheets
that he currently maintains and e-mails to users all over the world each week. He spends too
much time and effort maintaining the current spreadsheet paradigm, and he wants to both
automate distribution of BI reports and improve the quality of the analysis that he provides.
Improved data quality is also a major short-term goal of the company’s CFO, because he has
been worried about valuable corporate data being e-mailed to (and duplicated and manipulated
on) insecure PCs and laptops all over the company.
Bruce has heard that Oracle OLAP is state of the art and so easy to use that even he can do it (no
programming is required). He has decided to design his first OLAP system with Oracle. He
needs to provide reporting and analysis of XYZ daily sales performance, keep track of the stock
situation, and also monitor performance of sales versus the monthly sales targets that the CEO
has set for each store. Other requirements for the new system include the following:
• XYZ regional managers in the Americas, Europe, and Asia Pacific regions need regional
analysis so that they can see the summary for their region and compare it with those for
other regions. They also need the ability to drill down into detail as required, including a
country, areas within a country, and a store.
• The CEO needs to be able to see both the “big big picture
picture” and the detailed numbers
numbers.
Therefore, the system must provide drill-down paths through the data so that the CEO can
look at individual stores and product items for particular days or weeks, if necessary.
• XYZ stores have different profiles based on their location. Some stores are located in city
centers, some in out-of-town retail parks, and some are in airport departure terminals. The
marketing department needs to know how stores of different types perform based on sales
and stock. It has asked Bruce to provide an easy way to select particular stores for detailed
product analysis based on their store type
type.
• The buyers at HQ are responsible for monitoring how their products are selling as
compared to expectations. They also need to stock their products to the right levels in the
stores. In the past, they have asked Bruce for reports that list the products they are
responsible for with sales and stock figures, along with year-to-date figures and
comparisons with previous time periods. In addition to these same capabilities, they want
to report on all the products manufactured for them by particular suppliers, so that they can
quickly identify whether poor performance is supplier related,
related indicating a quality or
delivery issue.
• Merchandisers spend considerable time coordinating displays in the stores so that the stores
look attractive. In the fashion world, this means that they invest time in ensuring that the
right color mix is balanced across the display. Therefore, they need reports and charts that
contrast products that are of the same color.

Oracle Database 10g: Using OLAP 1-32


Practice 1 (continued)
Dimensional Modeling Exercise
On the basis of this initial business analysis, you have offered to help Bruce with the design of
hi dimensional
his di i l model d l that
th t will
ill make
k it easy for
f him
hi to
t meett all
ll off these
th requirements
i t as well
ll as
the unpredictable requirements that he has not yet documented.
Use the following questions to aid in your dimensional model design:
1. What dimensions are needed? For each dimension, do the following:
A. Identify any hierarchies that might be useful (at least one), and their levels.
B. List any attributes that should be considered in the design. For each attribute, specify
the level to which the attribute would be associated.
associated
2. What measures are needed? Consider the following:
A. First, what are the base measures that would have to be fetched from XYZ
operational systems (Point of Sales, Stock Management, Buying, and Merchandise
Planning systems) and stored in the multidimensional system?
B. Then list the calculations that would enrich the reporting and provide better insight
into the OLAP system.
Dimension 1:
Hierarchy 1: Hierarchy 2:
Levels Levels
^ ^

^ ^

^ ^

^ ^

Attributes:

Oracle Database 10g: Using OLAP 1-33


Practice 1 (continued)
Dimension 2:
Hierarchy 1: Hierarchy 2:

Levels Levels
^ ^

^ ^

^ ^

^ ^

Attributes:

Dimension 3:
Hierarchy 1: Hierarchy 2:

Levels Levels
^ ^

^ ^

^ ^

^ ^

Attributes:

Oracle Database 10g: Using OLAP 1-34


Practice 1 (continued)

Measures:

Stored measures: Calculated measures:

Oracle Database 10g: Using OLAP 1-35


Objectives
In this lesson, you learn about the architecture of the Oracle OLAP (online analytical
processing) option and the components of Oracle OLAP that play a role in processing data.
You also learn about the administrative and end-user tools with which you can explore the
rich features of OLAP.

Oracle Database 10g: Using OLAP 2-2


Oracle OLAP Option: Architectural View
In the lesson titled “Defining OLAP Concepts,” you learned that in Oracle Database 10g, all
data (relational and multidimensional) is stored in one Oracle database. You also learned that
Oracle OLAP provides native multidimensional data types within the database.
A high-level architectural view of the Oracle OLAP option contains three parts:
• End-user tools, which provide access to OLAP data for a wide spectrum of analytic
needs
• Oracle Database 10g OLAP option, which comprises:
- Multidimensional data types
- OLAP calculation engine
- Open-access interfaces
• Administrative tools used to create and manage multidimensional data types. Oracle
provides two administrative tools that can be used to create multidimensional data
types in Oracle Database 10g:
- Oracle Warehouse Builder
- Analytic Workspace Manager
Each part of this architectural view is examined in this lesson.

Oracle Database 10g: Using OLAP 2-3


Components of Oracle OLAP
With the Oracle OLAP option, you get two powerful arenas of functionality: the OLAP API
and the analytic workspace (AW).
OLAP API Functionality
The Oracle OLAP option provides a specialized Java API that developers can use to exploit
the full power of the Oracle OLAP option by using advanced dimensionally-aware tools and
applications. The OLAP API is used by Oracle business intelligence tools such as OracleBI
Beans, OracleBI Discoverer, OracleBI Spreadsheet Add-In, and Oracle Enterprise Planning
and Budgeting.
The OLAP API is designed to work with both multidimensional data types and relational
data types in the Oracle database.
• The API enables you to directly access multidimensional data types in the AW.
• To access relational data types, you can register a relational physical dimensional
model (such as a star or snowflake schema) to the Oracle Database OLAP Catalog.
Therefore, tools that use the OLAP API can be deployed against multidimensional analytic
workspaces or suitable relational schemas that are registered to the Oracle OLAP option’s
metadata layer.

Oracle Database 10g: Using OLAP 2-4


Components of Oracle OLAP (continued)
The Analytic Workspace is the container for the multidimensional data types and which
leverages the multidimensional calculation engine of the OLAP Option. The AW also
provides a standard SQL interface, an XML API for administration, and a programming
language (OLAP DML).
Multidimensional Data Store
The OLAP option provides true array-based multidimensional data types within the Oracle
database. These multidimensional data types are contained in special tables in Oracle called
analytic workspaces. Some data types are used to store data, whereas others are calculated
instantaneously using the multidimensional engine.
Multidimensional Calculation Engine
The OLAP Option’s multidimensional engine includes an impressive library of
multidimensional-aware calculation functions and support for planning functionalities such
as statistical forecasts, models, allocations, projections, and “what-if”scenarios, in the
context of Analytic Workspaces. The multidimensional engine interacts with the
multidimensional data types in the analytic workspace in the Oracle database.

Oracle Database 10g: Using OLAP 2-5


Query Access to the Analytic Workspace
Different users with different end-user tool requirements can all access the same data, take
advantage of the same calculations, and benefit from the same security, scalability,
performance, and availability of the Oracle database.
Dimensionally aware tools: Oracle Business Intelligence tools take full advantage of the
multidimensional query data model provided by the Oracle OLAP option through the OLAP
API. They include OracleBI Spreadsheet Add-In, OracleBI Discoverer, OracleBI Beans,
Oracle Enterprise Planning and Budgeting, and OracleBI Reports.
SQL tools: As stated previously, SQL tools and applications can access analytic workspace
data. For example, Oracle Application Express (formerly known as HTML DB) is an easy-
to-use tool that is supplied with Oracle Database 10g for Web access to the Oracle database.
Oracle Application Express is an example of a SQL-based application with no built-in OLAP
knowledge that can nevertheless leverage the power of Oracle OLAP.
Tools and applications from Oracle partners: Third-party tools from independent software
vendors and Oracle partners, such as Arcplan, Business Objects, Cognos, and a large and
growing number of business intelligence vendors throughout the world, access OLAP data
through the Oracle OLAP option. Some of these vendors’ tools leverage the OLAP API,
whereas others exploit the SQL query interface.
Oracle Database 10g: Using OLAP 2-7
OracleBI Spreadsheet Add-In
OracleBI Spreadsheet Add-In makes it easy to access OLAP data through the familiar
spreadsheet environment of Microsoft Excel.
After installation of OracleBI Spreadsheet Add-In, “OracleBI” appears as a new menu item
in Excel. By using OracleBI Spreadsheet Add-In, you can establish a secure connection to
the OLAP data source and use Excel as the front-end access tool to the data in the database.
Here are some of the features of OracleBI Spreadsheet Add-In:
• It combines the flexibility and familiarity of Excel and the power, scalability, and
security of the Oracle OLAP option.
• OracleBI Query and Calculation Builders: After the connection is established, you can
use the wizard-driven interface to drill, pivot, page through large cubes, and create
reports.
• Excel features: You can use all the powerful data-formatting features of Excel,
combine Oracle OLAP data with other Excel data, and write Excel macros that
leverage all your data. You can also create formulas and graphs in Excel, thereby
combining the powerful analytic capabilities of Oracle OLAP with standard Excel
functions that you know and use each day.

Oracle Database 10g: Using OLAP 2-8


OracleBI Discoverer
OracleBI Discoverer is another Oracle Business Intelligence tool that can directly access
Oracle OLAP data. Discoverer Plus OLAP is an ad hoc query, reporting, analysis, and Web-
publishing tool. It enables you to:
• Perform OLAP query, reporting, and analysis on both multidimensional data models
(analytic workspaces) and relational OLAP data models (star or snowflake schemas).
• Access and analyze multidimensional data from your company’s database without
having to understand complex database concepts. The wizards and menus of
Discoverer Plus OLAP guide you through the steps to retrieve and analyze
multidimensional data.
Because Discoverer Plus OLAP understands the dimensional data model, you formulate your
queries in the language of business—you use dimensions, hierarchies, levels, and measures
through a simple interface. You can also exploit the rich features of OLAP through
dimensionally-aware query and calculation builders, thereby simplifying the tasks of
defining queries and calculations. Worksheets that are authored in Discoverer Plus OLAP are
published to the Web, where Discoverer Viewer and Oracle Portal users can access them.
In the lesson titled “Building Analytical Reports with OracleBI Discoverer Plus OLAP,” you
learn how to use Discoverer Plus OLAP to analyze data in the AW that you build before the
lesson.
Oracle Database 10g: Using OLAP 2-10
OracleBI Beans
OracleBI Beans is used by business intelligence and OLAP developers. OracleBI Beans is
used for developing applications such as Oracle Enterprise Planning and Budgeting and tools
such as OracleBI Discoverer and OracleBI Spreadsheet Add-In. BI Beans is also available to
third-party software developers to accelerate development of custom OLAP applications.
JDeveloper Integration
BI Beans is a set of standards-based Java beans that is integrated into Oracle JDeveloper. It
provides analysis-aware application building blocks designed for the Oracle OLAP option of
the Oracle database. Using BI Beans, you can create customized business intelligence
applications that take advantage of the robust analytic capabilities of Oracle OLAP.
Applications can include advanced features such as interactive user interfaces, drill-to-detail
reports, forecasting, and what-if analysis. BI Beans includes Java beans for acquiring data
from the Oracle database, presenting data in a variety of crosstab and graph formats, and
saving report definitions, custom measures, and data selections.
Using BI Beans, you can develop business intelligence applications from Oracle JDeveloper,
or any Java application development environment, and deploy them through any application
server as a thin or thick client.

Oracle Database 10g: Using OLAP 2-11


OracleBI Reports
OracleBI Reports enables businesses to provide immediate access to information for
individuals at all levels (within and outside the organization) in a scalable and secure
environment.
OracleBI Reports can connect to an Oracle OLAP data source by using SQL or the OLAP
API (as a pluggable data source).

Oracle Database 10g: Using OLAP 2-12


Oracle Enterprise Planning and Budgeting
Oracle Enterprise Planning and Budgeting (EPB), a part of Oracle Corporate Performance
Management (CPM), is used by organizations to develop comprehensive analysis and
planning processes.
Like OracleBI Discoverer, EPB provides sophisticated tools for navigating and analyzing
dimensional data. EPB uses definitions of business rules, tasks, and schedules to create a
workflow and to plan a framework that has a focus on the budgeting and forecasting
processes.
Technical Note
Unlike other OLAP-enabled tools, the EPB application builds and maintains its own AWs in
order to support EPB-specific functionality. Therefore, it does not use Analytic Workspace
Manager (AWM) or Oracle Warehouse Builder (OWB) to create and maintain its OLAP
data.

Oracle Database 10g: Using OLAP 2-13


Oracle Application Express
The Oracle OLAP option provides a SQL interface to access multidimensional data types,
thus enabling any SQL-aware tool to access data in the analytic workspace.
Oracle Application Express is an easy-to-use report builder that is provided with Oracle
Database 10g to simplify the creation of database-centric interactive Web pages.
Thus, with the Oracle OLAP option, you can use Oracle Application Express to provide
Web-based access to key performance indicators such as profitability, sales, units shipped,
trends, and period-to-period comparisons and forecasts.
It provides support for some interactive reporting (for example, you can use hypertext links
to call more SQL queries), but it is not a fully interactive analysis system like OracleBI
Discoverer or like other specialized business intelligence tools.

Oracle Database 10g: Using OLAP 2-14


Tools to Build an Analytic Workspace
Two tools are available for IT and power users to easily build analytic workspaces (AWs)
and load them with data (for analysis with tools such as OracleBI Beans, OracleBI
Discoverer, and OracleBI Spreadsheet Add-In):
Analytic Workspace Manager (AWM)
• Is packaged with Oracle Database 10g (with the Oracle OLAP option)
• Builds AWs from cleansed data
OracleBI Warehouse Builder 10g R2 (OWB)
• Is an advanced end-to-end ETL tool that includes data-profiling and data-cleansing
technology
• Builds and manages entire data warehouses, optionally including AWs

Oracle Database 10g: Using OLAP 2-16


Analytic Workspace Manager (AWM 10g)
Oracle Database 10g Analytic Workspace Manager (AWM 10g) is a primary tool for
developing and managing analytic workspaces.
AW Life-Cycle Management
By using AWM, you can define a dimensional model, implement it, and manage it
throughout its life cycle. Your dimensional model might involve many different types of
calculations beyond simple aggregation. AWM is simple and focuses solely on these tasks.
The design focus of AWM is ease of use, dimensional modeling, and the definition of
aggregations and other calculations.
Source Data Requirements
Generally, you build AWs from tables or views that exist in the Oracle database.
You can also build AWs directly from flat files outside the database. You can use the
“external tables” feature to access such files. Data in non-Oracle databases can be either
moved into an Oracle database or accessed via an Oracle gateway.

Oracle Database 10g: Using OLAP 2-18


Creating an Analytic Workspace Using AWM 10g
Analytic Workspace Manager supports the complete process of creating an AW from
beginning to end in a single, dimensionally-aware design environment.
The creation process includes three easy steps:
1. Design the dimensional model.
2. Map the dimensional object to the source data.
3. Load the data into the AW.
After you have performed these steps, the AW is immediately available for your tools to
query.
In later lessons, you use AWM 10g to design and build your analytic workspace in Oracle
Database 10g.

Oracle Database 10g: Using OLAP 2-19


Oracle Database 10g: Using OLAP 2-20
Practice 2: Overview
In this practice, you review the components of OLAP by answering questions.

Oracle Database 10g: Using OLAP 2-21


Objectives
In this lesson, you learn to use the Analytic Workspace Manager 10g (AWM 10g) tool to
build multidimensional database objects in the analytic workspace (AW).
You create a basic cube and its dependent components (dimensions and measures). You load
data into the dimensions and measures, and then view that data.

Oracle Database 10g: Using OLAP 3-2


Examining the Logical Model
After the logical data model is designed, including the dimensions and measures that are
needed in your AW, you can source data from suitable relational tables or views. In this
class, the SH schema contains everything needed to source the data.
In this lesson, the following logical model is defined for the AW:
Dimensions
• Time: Shows how data varies over time
• Product: Shows how data varies by product
• Channel: Shows how data varies according to each distribution channel
Measures
• Budget sales shows the sales numbers for the budget
• Budget profit shows the profit numbers for the budget

Oracle Database 10g: Using OLAP 3-3


Examining the Logical Model: Dimensions
After you have identified dimensions, you can identify the levels of summarization within
each dimension. Analysis requirements reveal that:
• There are five distribution channels: Direct Sales, Telesales, Catalog, Internet, and
Partners. These values are the lowest level of detail in the data warehouse and are
grouped in the Channel level. From the order of the highest level of summarization to
the lowest level of detail, the levels are Total Channel, Class, and Channel. There are
three Class levels: Direct, Indirect, and Others.
• The Product dimension has four levels (from the highest to the lowest): Total,
Category, Subcategory, and Product.
• The Time dimension has three levels (from the highest to the lowest): Year, Quarter,
and Month. Data is available for the years 2002–2006.

Oracle Database 10g: Using OLAP 3-4


Role of Cubes
Cubes provide a convenient way of collecting similar measures of the same
dimensionality. It is not uncommon for many measures to have the same shape, and
so by defining their shape (and other shared characteristics) for a cube, you can
save time when building your AW. A cube is simply a logical object that helps an
administrator to build and maintain an AW. It also aids in the definition of measures
with common characteristics, such as sparsity patterns and aggregation rules.
Measures in the same cube have the same relationships to other logical objects and
can easily be analyzed and displayed together.
The edges of a cube are defined by its dimensions. Although there is no limit to the number
of edges of a cube, data is often organized for display purposes along three edges: row edge,
column edge, and page edge. A single dimension or multiple dimensions can be placed on an
edge. For example, budget data can be organized into a cube whose edges contain values
from the Channel, Product, and Time dimensions and whose body contains profit and
revenue data.
Multidimensional cubes are stored in AWs. A particular AW may contain more than one
cube, and each cube may describe a different dimensional shape.

Oracle Database 10g: Using OLAP 3-5


Examining the Logical Model: Cubes and Measures
In this lesson, you create the first cube, Budgets, containing two measures. These are base
measures, which store the facts collected about your business.
Each measure that belongs to a particular cube shares particular characteristics with other
measures in the cube, such as the same dimensions. The Budgets cube includes:
• Dimensions: Time, Product, and Channel
• Measures: Budget Sales and Budget Profit
The data for these measures, and the dimensions that organize the measures, will be sourced
from tables in the SH schema, as discussed in the next slide.

Oracle Database 10g: Using OLAP 3-6


Source Data
The SH schema is part of the sample schemas that are shipped with Oracle Database 10g. In
this lesson, you build an AW on the basis of sales history data.
For this class, two additional tables have been created:
BUDGET_TBL: A fact table that contains budget sales and budget profit data
MONTH_STAR: Presents data from a monthly (rather than daily) perspective
Note: BUDGET_TBL is not part of the sample schemas. It is created for this class.

Oracle Database 10g: Using OLAP 3-7


Starting AWM
You can start the AWM 10g tool by clicking the awm.exe file. This file is located in the
AWM\bin directory.
Alternatively, if you have created an icon on the desktop for the awm.exe executable, you
can double-click the icon.

Oracle Database 10g: Using OLAP 3-8


Creating a Database Connection
To create a database connection, perform the following steps:
1. Right-click the database node in the left navigator.
2. Enter the connection information in the dialog box.
3. Click Create.
Note: Because Oracle OLAP is part of the database, a standard database connection or
authentication is used.

Oracle Database 10g: Using OLAP 3-9


Connecting to a Database
To connect to a database, perform the following steps:
1. Click the description name in the Databases node in the left navigator.
2. Enter the username and password in the dialog box.
3. Click OK.

Oracle Database 10g: Using OLAP 3-10


Creating an Analytic Workspace
To create an analytic workspace, perform the following steps:
1. Find the schema name under which you want the AW to reside. Expand that schema
name. The Analytic Workspaces node appears.
2. Right-click the Analytic Workspaces node. The Create New Analytic Workspace dialog
box appears.
3. Enter a name for your AW. Optionally, choose a tablespace where this AW is stored.
By default, the tablespace defaults to the default tablespace for the schema. This is set
up by the database administrator (DBA) when the schema is created.
After you have created the AW, it appears in the navigator under the node where it is
created. It is attached in read/write mode, which means that you can make changes to it.
You can create a workspace from a template. A template holds the definition of objects. You
can use templates to create analytic workspaces, cubes, and dimensions.
Note: After you have created an AW, a table named AW$aw_name is created at the database
level. (aw_name is the name that you have chosen for your AW.) This table stores all of the
multidimensional objects in your AW.

Oracle Database 10g: Using OLAP 3-11


Analytic Workspace: Creation and Maintenance Privileges
To create an AW and perform ongoing maintenance on it, you must have the following roles
and privileges:
• OLAP_USER role: You need this privilege to create and manage an AW in your own
schema. This privilege is also required for all end users of your OLAP system
• SELECT privilege on the source schema tables: To build your AW from relational
data sources, you need the privilege to read from those tables or views.
• Quota space: When you build an AW, you use disk space. You must have sufficient
quota on the tablespace in which the workspace is created.
• SELECT, INSERT, and UPDATE privileges: To allow you to maintain an AW that is
not in your own schema, the DBA can grant privileges to you for that specific AW (or
directly on the AW$table_name table)
The DBA, if that is not you, will be able to set this up for you.
Note: Do not grant the OLAP_DBA role to any user, except the system DBA. This role is
unnecessary for cube building, and grants many more privileges than are recommended.

Oracle Database 10g: Using OLAP 3-12


Using Multilanguage Support
A single AW can support multiple languages. This enables the users of your OLAP
applications and tools to view the metadata and descriptive attributes in their native
languages. The number and choice of languages is restricted only by the database character
set and your ability to provide translated text.
To add support for multiple languages, perform the following steps:
1. In the Model View navigation tree, expand the folder for the AW.
2. Click the Languages folder, and select the languages for the AW on
the General tabbed page.
3. As you create your objects, such as dimensions, levels, hierarchies, attributes, cubes,
measures, calculated measures, and measure folders, open the Translations tabbed page
of the property sheet. Enter the object labels and descriptions in each language.
4. When you map the dimensions, map the attributes to columns for each language.
Note: In this class, a single language is used, which is American.

Oracle Database 10g: Using OLAP 3-13


Creating Dimensions
Dimensions are lists of unique values that identify and categorize data. They form the edges
of measures (facts). Dimensions have structure that helps in the navigation of data and the
definition of calculations. This structure includes levels, hierarchies, and attributes in the
logical model. You define these supporting objects, in addition to the dimension itself, in
order to have a fully functional dimension.
Dimension Type
Most dimensions that you create are of the default “User Dimension” type. In the example
shown, a Time dimension is created. If you explicitly set the dimension type to “Time
Dimension,” AWM automatically prepares some additional time attributes. When populated,
these attributes facilitate time series calculations on the measures that share this dimension.
It is recommended that all your time dimensions are created with this setting.
Other Tabbed Pages
The Translations tabbed page enables you to provide labels in languages that your AW uses.
The Implementation Details tabbed page enables you to identify certain dimension
characteristics. The implementation details are examined in detail in the lesson titled
“Applying Advanced Dimensional Design and Cube Processing Techniques.”

Oracle Database 10g: Using OLAP 3-14


Creating Levels
For business analysis, data is typically summarized at various levels. For example, your
database may contain daily snapshots of a transactional database. Days are thus the base
level. You might summarize this data at the monthly, quarterly, and yearly levels.
Levels have parent-child or one-to-many relationships, which form a hierarchy. For
example, each month summarizes days, each quarter summarizes months, and each year
summarizes quarters. This hierarchical structure enables analysts to detect trends at the
higher levels and then drill down to the lower levels to identify factors that contributed to a
trend.
To create a level for any dimension, right-click the Level icon beneath the dimension, and
then select Create Level. Fill in the name, labels, and a description. The labels can be used
in reports; the description enables you to comment on the object. Repeat the process for each
level in the dimension.

Oracle Database 10g: Using OLAP 3-15


Creating Hierarchies
A hierarchy is a way of organizing dimension members. It may be value based (an
Organization hierarchy) or level based (the Calendar hierarchy). You can define level-based
hierarchies, where ordered levels are used as a means of organizing data. These hierarchies
can be used to define data aggregation. For example, in a Time dimension, a hierarchy might
be used to aggregate data from the month level to the quarter level to the year level. A
hierarchy can be used to define a navigational drilldown path, regardless of whether the
levels in the hierarchy represent aggregated totals.
Dimensions can have one or more hierarchies. If you define multiple hierarchies, make sure
to define one of them as the default hierarchy.
As shown in the slide, use the following steps to define a hierarchy:
1. Right-click the hierarchy icon in the navigator. Choose Create Hierarchy.
2. Name the hierarchy. You can provide descriptive labels that can be used in reports.
Select the “Set as Default Hierarchy” option if this is the only hierarchy for the
dimension or if it is the hierarchy that will be used most frequently for analysis.
Choose either Level Based Hierarchy or Value Based Hierarchy.
3. Select the levels for your hierarchy. The levels must be organized from the highest
level of aggregation to the lowest.
Oracle Database 10g: Using OLAP 3-16
Attributes
Attributes contain descriptive information about dimension members that are used for data
selection and identification. They are used for labeling cross-tabular and graphical data
displays, selecting data, organizing dimension members, and so on.
AWM 10g defines basic attributes automatically. For each dimension, it creates long and
short description attributes. For a Time dimension, it also creates time-span and end-date
attributes.
You can create your own attributes to further enrich the AW.
The General tabbed page provides the most basic information about logical attributes.
The Implementation Details tabbed page identifies the data type for the attribute. This data
type should match the source data.
Attributes are discussed in detail in the lesson titled “Applying Advanced Dimensional
Design and Cube Processing Techniques.”

Oracle Database 10g: Using OLAP 3-17


Mapping Dimensions
To map your dimensions to a data source, perform these steps:
1. In the navigator, select Mappings for the dimension that you want to map.
A list of schemas appears.
2. Find the schema to which you want to map your dimension, click the + button, and
then choose either Tables or Views (depending on what you are mapping to).
3. Find the table or view name and double-click, or drag it to the mapping canvas. When
on the canvas, the structure of the table is visible.
To view data, right-click the table (or view) name and choose View Data.

Oracle Database 10g: Using OLAP 3-18


Mapping Dimensions (continued)
4. Drag the cursor from the column name in the relational source to the destination object
name in the dimension.
5. After your mappings are complete, click the Apply button at the base of the mapping
canvas to save your work.
Note the following:
• It is perfectly valid to map the same source column to more than one of your logical
dimension components. In this example, the same DESC columns for each level are
mapped to both the Long and Short Description attributes of the Time dimension.
• If you need to remove a mapping line drawn in error, simply highlight it by clicking it
and either press the [Delete] key of your keyboard or right-click and select “Remove
Mapping…”
• In this example, all the source information needed is in a single table. Note that other
dimensions may be sourced from more than one table. To do this, select all the
required tables from the source schema and do the appropriate mappings.

Oracle Database 10g: Using OLAP 3-19


Viewing Mapping Options
Your mappings can become cluttered in appearance. To help you organize and view
mappings more clearly, use the buttons at the top of the mappings window. Clicking the
buttons does the following:
1. Graphical Mapping View shows the mappings to you in a graphical format. This is the
default.
2. Table Mapping View lists the relational table (or view) and multidimensional objects
in a table format.
3. Auto Arrange Mappings straightens out and organizes your mapping lines between the
multidimensional objects and the relational tables or views.
4. Auto Map Star Schema automatically maps the source and target objects. The source
must be a star schema, and the object names must match. In a star schema, all levels
and attributes are in one table.
5. Remove All Mappings deletes the mapping lines you have created between the source
and target objects.
6. Type of Dimension Table(s) enables you to specify a star schema where all levels and
attributes are in one source table; a snowflake schema where levels and attributes are
in two or more source tables; or other table type where attributes for a level are in two
or more source tables.
Oracle Database 10g: Using OLAP 3-20
Loading Data
The Maintenance Wizard loads data. The same wizard is used to load data for dimensions,
cubes, and measures.
Loading Dimension Data
You can load mapped dimension data as you build the dimensions, or you can load
dimension data later when you load the measure data. In the example in the slide, data for
the Time dimension is loaded.
To load dimension data, right-click the name of the dimension into which you are loading
data, and then select the Maintain Dimension option. The Maintenance Wizard appears and
leads you through a set of steps to load data from the mapped relational objects to the
multidimensional objects in the AW.
In the first step of the wizard, you identify the objects into which data are to be loaded. You
can choose dimensions, cubes, and measures. After selecting the source objects and moving
them to the right side of the Maintenance Wizard page, click Finish to accept the default
processing options and load the data immediately.
Advanced options of the Maintenance Wizard, such as maintenance job scheduling, are
covered in the lesson titled “Applying Advanced Dimensional Design and Cube Processing
Techniques.”
Oracle Database 10g: Using OLAP 3-21
Loading the Data Report
After loading data, you can view the report. In the example shown, the report displays
information about the Time dimension because that is the only object selected for data
loading.
After successful completion, the dimension values are available for viewing in the AWM
10g tool.
Technical Note
All the maintenance logging goes into the XML_LOAD_LOG table, which belongs to the
OLAPSYS user. This table can be reviewed later, if required.

Oracle Database 10g: Using OLAP 3-22


Using the Data Viewer
You can use the Data Viewer to examine your newly loaded data. To use the Data Viewer,
right-click the object for which you want to see data, and then select the View Data option.
In the example in the slide, the Data Viewer is used to display the loaded Time dimension
values. Because a hierarchy is set up for the Time dimension, you can navigate through the
data. Using the drill symbols (“+” and “–”), you can drill up or down on the data to see the
data in the higher or lower levels.
You can choose to view the data at a specific level by choosing that level from the pull-
down list at the bottom of the window.

Oracle Database 10g: Using OLAP 3-23


Using Templates
The template feature in AWM saves the definition of logical objects outside the confines of
the database. Using a saved template, you can create a new AW, a dimension, and a cube
exactly like an existing object with or without mappings. Templates do not include data.
A template contains the XML definitions of objects in a standard-form AW. Using a saved
template, you can create an AW as a copy of an existing one. Or, you can use a template to
import specific objects, such as dimensions.

Oracle Database 10g: Using OLAP 3-24


Configuring the Template Source
You can identify a default location in the file system to save your templates.
Note: You can always override this default when saving a template.
You can identify where your templates are stored in AWM.
To configure where AWM automatically searches for template files, perform these steps:
1. From the Tools menu, select Configuration.
2. On the Template tabbed page, click the ellipses button.
3. In the Open dialog box, identify the location of your templates in the File Name field.
4. Click the Open button, and then click OK.

Oracle Database 10g: Using OLAP 3-25


Creating Dimensions Using Templates
To create a dimension from a template, perform these steps:
1. Right-click the Dimensions node, and select Create Dimension From Template.
2. If necessary, navigate from the template source folder to the appropriate subfolder (in
this case, E:\labs\Templates\Dimensions). Select the template file, and click Create.
3. The template object definitions are imported, and the result is shown in the navigator.
Templates contain the definition of an object but not the object’s data. Templates can include
mappings to the relational data source. When you create an object based on a template, you
must load data as a separate step.
Saving a Dimension Template
To save the definition of a dimension to a template, perform these steps:
1. Right-click the dimension in the navigator, and select Save Dimension to Template.
2. Navigate to the appropriate subfolder, and enter a name for the template file.
3. Click Save.
Note: If you have several dimensions that you want to create from templates, you can
multiselect them, and AWM will process each one in turn.

Oracle Database 10g: Using OLAP 3-26


Creating Cubes
What Are Cubes?
Cubes are containers of measures (facts). They simply provide a convenient way of
collecting up measures with the same dimensions. Therefore, all measures in a cube are
candidates for being processed together at all stages: data loading, aggregation, and storage.
Cubes are only visible to the cube builder (end users only see the measures they contain) and
simplify the setup and maintenance of measures in AWM.
Creating Cubes
To create a cube, right-click the Cubes node in the navigator, and then select the Create
Cube option. The Create Cube window appears.
Note: You can also create a cube from a cube template if you have a template available.

Oracle Database 10g: Using OLAP 3-27


Creating Cubes (continued)
The Create Cube wizard provides a tabbed page interface that enables you to specify the
logical model and processing options for a cube.
General Tabbed Page
On the General tabbed page, enter the basic information about the cube:
• Provide the cube with a distinct name and provide the short and long label
descriptions.
• Identify the dimensionality of the cube by using the arrow keys to move dimensions
from the Available Dimension list to the Selected Dimension list. After you define the
dimensionality, all measures that you create based on this cube will have the same
dimensionality.
Other Tabbed Pages
The Translations tabbed page enables you to provide long and short descriptions for the cube
in each language that the AW supports.
The Create Cube window gives you access to four other tabbed pages. These tabbed pages
categorize details about your cube and enable selection of certain processing options other
than the default settings. These tabbed pages are covered in detail in the lesson titled
“Applying Advanced Dimensional Design and Cube Processing Techniques.”
Oracle Database 10g: Using OLAP 3-28
Creating Measures
Base measures store the facts collected about your business. Logically, the edges of a
measure are organized by dimensions, and the body of the measure contains data values.
Each measure belongs to a particular cube, and by default all the settings for a measure
(such as dimensions) are inherited from the cube.
To create a measure, right-click the Measures node in the navigator, and then select the
Create Measure option.
General Tabbed Page
On the General tabbed page, you create a name and add label information. Long labels are
used by most OLAP clients for display. If you do not specify a value for the long label, then
it defaults to the measure’s name.
Other Tabbed Pages
The Translations tabbed page enables you to provide long and short descriptions for the
measure in each language that the AW supports.
The other tabbed pages (Implementation Details, Rules, and so on) enable the selection of
certain measure-specific processing options other than the settings that are applied by the
definition of the cube. These tabbed pages are examined in detail in the lesson titled
“Applying Advanced Dimensional Design and Cube Processing Techniques.”
Oracle Database 10g: Using OLAP 3-29
Mapping Measures
After creating logical objects, you can map them to relational data sources in the Oracle
database. Afterward, you can load data into your analytic workspace by using the Maintain
Analytic Workspace Wizard.
To map your measures to a data source, perform these steps:
1. In the navigator, choose Mappings for the cube that contains the measure that you want
to map. A list of schemas appears. Find the schema to which you want to map your
measure, and then click the + button.
2. Select either Tables or Views, depending on what you are mapping to.
3. Find the table or view name and double-click, or drag it to the mapping canvas. When
on the canvas, the structure of the table is visible.
Note: If you want to see the data in the table or view, right-click the name of the table or
view, and then select the View Data option.

Oracle Database 10g: Using OLAP 3-30


Mapping Measures (continued)
4. Drag the cursor from the column name in the relational source to the destination object
name in the measure.
Note: The mapping canvas enables you to map the contents of the source data to any level
of dimensions. Here, because Budgets are set by product, and by channel for each month,
map them to the Month, Product and Channel levels. In the lesson titled “Applying
Advanced Dimensional Design and Cube Processing Techniques,” there is advice on
handling AWs where source data for different cubes and measures is loaded at different leaf
levels of detail.

Oracle Database 10g: Using OLAP 3-31


Loading Data
The Maintenance Wizard loads and aggregates data as a single job. You can load:
• All mapped objects in the analytic workspace
• All mapped measures in a cube
• Individually mapped measures
• Individually mapped dimensions
To load data, right-click the desired object name into which you are loading data, and then
select the Maintain option. Recall that previously in this lesson, the Maintenance Wizard is
used to load data for the Time dimension.
Example
In the example, the Budgets cube is maintained. This results in the loading of data for all the
dimensions that organize the cube and all the mapped measures associated with the cube.

Oracle Database 10g: Using OLAP 3-32


Loading Data (continued)
The Maintenance Wizard takes you through a set of steps to load data from the mapped
relational objects to the multidimensional objects in the AW.
In the first step of the wizard, you identify the objects to which data is to be loaded. If you
choose cubes, all the measures for the cube are selected. Alternatively, you can choose a
specific measure of a cube. After a measure or cube is selected, the associated dimensions
are automatically selected as well. AWM, by default, selects the related dimensions for the
cube. This is because AWM is dimensionally aware, and knows that the dimensions must
exist and be populated in order for measures to be loaded. The dimensions organize the
measures physically not just logically in an AW, so they must be maintained before the
measure data can be loaded.
You can also choose to run the job immediately, enter it in the Oracle job queue, or save it as
a SQL script. These options are discussed in the lesson titled “Applying Advanced
Dimensional Design and Cube Processing Techniques.” To run the maintenance task
immediately and interactively, simply click the Finish button.

Oracle Database 10g: Using OLAP 3-33


Loading Data Report
After the loading of data is completed, you can view the report.
After successful completion, the data in your AW is ready to be analyzed.
Technical Note
All the maintenance logging goes into the XML_LOAD_LOG table, which belongs to the
OLAPSYS user. This table can be reviewed later, if required.

Oracle Database 10g: Using OLAP 3-34


Viewing Measures
After data is loaded, you can preview it by using the Data Viewer. To see the data, right-
click the name of the measure or cube that you want to view, and then select View Data from
the submenu. A tabular report appears. If you view a cube, all measures in the cube are
displayed.
In the Data Viewer, you can:
• Drill up or down on the dimension values
• Pivot or rotate the view of the data by dragging the edges (rows, columns, and pages)
to new positions
This basic crosstab control is used extensively in Oracle Business Intelligence tools,
including OracleBI Beans, Discoverer Plus OLAP, and administrative tools such as AWM
and Oracle Warehouse Builder. Also, third-party tools and applications sold by Oracle
partners that use the OracleBI Beans technology use this same user interface. In end-user
tools and applications, more functionality (such as formatting, color coding, and cell
actions) is enabled in Discoverer Plus OLAP, as you see in the lesson titled “Building
Analytical Reports with OracleBI Discoverer Plus OLAP.”
Note: From the File menu within the Data Viewer, or from the Query Builder tool,
you can access the Oracle OLAP Query Builder. This query wizard is used throughout
Oracle Business Intelligence tools.
Oracle Database 10g: Using OLAP 3-35
Viewing Measures (continued)
As shown in the example in the slide, you drill down on data to the lowest levels of detail by
clicking the arrow icon to the left of the dimension value.
Notice that the measure appears to the user as fully aggregated at all level combinations of
all dimensions. This is an important feature of the Oracle OLAP dimensional model. All data
is presented to the end user as if it is already aggregated and calculated, even if some or all
of the data being displayed is being calculated on the fly.
For example, some of the budget data has been preaggregated during the maintenance task,
and some of it is being calculated dynamically. The end user cannot tell the difference, and
does not need to know. The AW contains the data and the calculation logic and presents the
results that the user needs. From the technical perspective, not even the query behind this
crosstab needs to know whether the measure cells being requested are precomputed or not.
The query simply requests these cells from the database, and the AW engine performs any
calculations required at query time.

Oracle Database 10g: Using OLAP 3-36


Summary
In this lesson, you learned the basics of creating an AW, defining multidimensional data in
the AW, mapping relational data sources to the objects in the AW, and loading data values
into the AW.

Oracle Database 10g: Using OLAP 3-37


Practice 3: Overview
In this practice, you build an AW with the basic components of dimensions, cubes, and
measures. You map the data in the AW to the relational sources, and you load data into the
AW from the relational sources.

Oracle Database 10g: Using OLAP 3-38


Objectives
In this lesson, you learn some of the more advanced cube-building techniques and topics. You
add more data to your analytic workspace (AW) and thereby learn more about attributes. You
learn about dimension implementation options and cube implementation tips, including
sparsity, compressed cubes, and cube partitioning. You learn more about aggregation in Oracle
OLAP.
This lesson focuses on creating and building the AW for sales measures and learning about
some of the advanced features of Oracle OLAP. This covers the physical implementation and
loading of stored measures.
Also, you are shown how Analytic Workspace Manager 10g (AWM 10g) simplifies the
process of adding new data to your cubes over time and refreshing the summaries when
changes occur.

Oracle Database 10g: Using OLAP 4-2


Adding to the Logical Model
In this lesson, you add new multidimensional data types to the AW. Three measures are added
for the analysis of actual sales data. These new measures use the existing dimensions, but also
need a new (fourth) dimension.
Dimensions
The additional Customer dimension is required for the new measures. The existing Product,
Time, and Channel dimensions are reused and shared with the Budget Sales and Budget Profit
measures created earlier.
Cubes and Measures
Earlier, you learned that cubes are logical containers for measures with the same dimensions.
Typically, similarly shaped measures in the same cube are candidates for being processed
together at all stages: data loading, aggregation, storage, and querying. Grouping measures in
this way simplifies the design, creation, and maintenance of the AW.
Therefore, you need to add a new four-dimensional cube to the AW. This cube will contain
three base measures: Sales, Quantity, and Costs.

Oracle Database 10g: Using OLAP 4-3


Adding to the Logical Model: Dimension and Hierarchy
You learned in the previous lesson that the purpose of a hierarchy is to provide the
relationships for summarization of measures in the cube and to make navigating multiple
levels of data easy and intuitive for the end user.
Because the same dimensions for Time, Product, and Channel that were created in the
previous lesson are used, their hierarchies are also reused.
The new Customer dimension has a single hierarchy: Customer. The Customer hierarchy is a
level-based hierarchy. A Customer dimension is needed in the AW because the sales revenue
and quantity measures are also dimensioned by Customer.
Note the levels that define the Customer hierarchy in the slide. The Customer hierarchy
enables you to group individual customers up through multiple levels based on where they are
geographically located.
Note: Although it is common for hierarchies to be level based, it is not a necessary condition.

Oracle Database 10g: Using OLAP 4-4


Adding to the Logical Model: Attributes
User-defined attributes can be used to simplify the selection of dimension values when you
use a MATCH condition in the Query Builder or in queries submitted to Oracle OLAP via SQL
or the OLAP API. In this lesson, you add two attributes to the Customer dimension: Customer
gender and Customer postcode.
Long and Short Descriptions
AWM 10g always creates long and short description attributes for every dimension. These
description attributes are displayed to the end user in reports and graphs. Most data sources
use codes (without descriptions) for dimension members; such codes have little or no meaning
to end users and do not result in an easy-to-use system.
It is generally a good practice to populate long descriptions with commonly understood terms.
For short descriptions (as the name suggests), use shorter versions of the long descriptions.
Short descriptions are typically used as labels on charts and as legends on graph axes.

Oracle Database 10g: Using OLAP 4-5


Source Data
In this lesson, you again use the SH schema to add new data to the AW that you created in the
previous lesson. Now, you create a new four-dimensional cube with Sales, Quantity, and Costs
measures.
The new measures share the Product, Channel, and Time dimensions already created in the
lesson titled “Building an Analytic Workspace” (and therefore populated from the
PRODUCTS, CHANNELS, and MONTH_STAR tables, respectively).
There is a new dimension table and a new fact table that are also used:
• For the Customer dimension, the source data resides in the CUSTOMERS_STAR table.
This table uses data from the SH CUSTOMERS and COUNTRIES tables to provide a
simplified source for this lesson. You can use relational views over source tables to
perform simple ETL (extract, transform, load)-like processing to make them easy for
you to use in your AWs.
• SALES_SUMMARY is a summary table that provides leaf-level data for the AW. It has
columns for Sales Amount, Sales Quantity, and Cost for goods sold by Month,
Customer, Channel, and Product.

Oracle Database 10g: Using OLAP 4-7


Creating a Dimension: Implementation Details
Surrogate Keys
In an AW, members within a dimension must be unique across all levels. The source data
usually does not enforce this uniqueness. Therefore, by default, AWM ensures uniqueness by
enabling the Generate Surrogate Keys option on the Implementation Details tabbed page.
If the source data uses the same dimension ID for different members at different levels of the
dimension, the Generate Surrogate Keys option remedies this problem by prefixing the ID
values read from the source data with the AW Level name.
For example, if source dimension IDs for City “London” and Region “Asia” are the same (for
example, “123”), then using Surrogate Keys results in their dimension members in the AW
being “CITY_123” and “REGION_123,” respectively.
Natural Keys
If your source data maintains uniqueness, and there is no possibility of the same ID being used
for different members of the dimension, then Natural Keys may be used. In this case, the AW
dimension IDs will exactly match the values in the data source.
Note: Value-based hierarchies are not level based and, therefore, cannot be defined on
dimensions that are maintained with Surrogate Keys.

Oracle Database 10g: Using OLAP 4-8


Creating User Attributes
To create a user attribute, right-click the Attribute node under the appropriate dimension, and
select Create Attribute from the menu.
Example
For the Customer dimension:
1. The Customer Gender attribute is added. The attribute type is User. It holds the gender
of every customer. Therefore, it is applicable to the leaf customer level only.
2. The data type for this attribute is TEXT, as shown on the Implementation Details tabbed
page.

Oracle Database 10g: Using OLAP 4-9


Examining Advanced Cube Settings
The next few sections cover the more advanced Cube implementation in detail. In the lesson
titled “Building an Analytic Workspace,” you accepted the defaults when creating the
BUDGETS cube. In this lesson, you learn about sparsity control, compression and partitioning
features, aggregation rules, and summarization strategies.
In the slide, the General tabbed page for the new SALES cube is displayed. However, before
clicking the Create button, you can fine-tune the settings on the following tabbed pages:
• Implementation Details
• Rules
• Summarize To
• Cache

Oracle Database 10g: Using OLAP 4-10


Creating a Cube: Implementation Details
Most of the advanced options for tuning your multidimensional model are found on the
Implementation Details tabbed page of the Create Cube window. Because the Sales cube
represents much more data than the Budgets cube, this provides the opportunity to learn about
some more advanced tuning topics.
As shown in the slide, the Implementation Details tabbed page contains four important tuning
features of Oracle OLAP, which are examined in detail in the following sections.
The correct use of these features ensures that your analytic workspace is very efficient and is
implemented in an optimal way.

Oracle Database 10g: Using OLAP 4-11


Sparsity
When there are a large number of empty cells in a cube, the cube is said to be “sparse.”
For example, if you are a manufacturer of consumer packaged goods, you do not sell one or
more of every single product you make to every customer, every day, through every sales
channel. Different customers buy different products, at different time intervals, and each
customer probably has a preferred channel. Different products may display different sparsity
patterns: Ice creams and cold drinks tend to sell faster in the summer, whereas warm arctic
coats are more popular in the winter (particularly in cold locations).
When using multidimensional technology, pay attention to sparsity so that you can design
cubes efficiently. The effect of sparsity in data (and a badly designed cube) can result in
tremendous growth in disk usage and a corresponding increase in the time taken to update and
recalculate data in the cube. Inefficient sparsity control in any multidimensional data store can
result in many empty cells actually being physically stored on the disk. This is something that
is less of a concern with relational technology, because it is rare to store a completely null row
in a table.
Oracle OLAP automatically deals with sparsity up to a point. But you, as a cube builder, can
provide Oracle OLAP with the information that you know about your data (and information
that Oracle OLAP needs to know) to deal with that data extremely efficiently.
Oracle Database 10g: Using OLAP 4-13
Sparsity (continued)
Sparsity is often expressed in percentage terms. Data is said to be 5% dense (or 95% sparse) if
only 5% of the possible combinations of the cells in a multidimensional measure or cube
actually contain data. In many cases, data is very sparse, especially sales and marketing data.
Only very aggregated data with a fairly small number of dimensions is typically dense enough
for you to not consider sparsity.
Sparsity tends to increase with the number of dimensions and with the number of levels and
hierarchies in each dimension. As you add dimensions to the definition of a cube, the number
of possible cell combinations can increase exponentially. Also, the granularity of data affects
sparsity. Low-level, detailed data is much more sparse than aggregate data. Very aggregate
data is typically dense.
Particular combinations of dimensions typically have different sparsity from others. For
example, Time dimensions and Line dimensions are often more dense than dimensions such
as Product, Customer, and Channel. This is because combinations of customers and products
are sparser than combinations of customers and time or sparser than combinations of products
and time. For this reason, AWM 10g asks you to confirm which of the dimensions for your
data are sparse dimensions and which ones are dense.

Oracle Database 10g: Using OLAP 4-14


Dimension Order and Sparsity
When you determine the sparsity settings for your cube, you should also consider the ordering
of the dimensions. After you have decided which of your dimensions are sparse, their ordering
on the Implementation Details tabbed page is important. You can improve the build and
aggregation performance of your AW by tuning the order in which the dimensions are
specified.
Generally, it is best to:
• Define a relatively small, dense dimension (such as Time) first in the list, followed by a
group of all the sparse dimensions. Use the up and down arrows to alter the ordering of
the dimensions as shown in the slide.
• List the sparse dimensions in order of size from the one with the most members to the
one with the least
In the SALES cube, there are 56,299 customers, 100 products, and 9 channels across the
various levels of aggregation, so the dimensions should be ordered in that order for optimum
efficiency.
When you make these choices, you impact the way that Oracle OLAP organizes data storage
in the Oracle database.
Note: You do not need to spend time on these guidelines if you have sparse data that would
benefit from the use of the AWM compression feature (discussed in the next few slides).
Oracle Database 10g: Using OLAP 4-15
Compressed Cubes
Oracle OLAP 10g introduces a new, internationally patented technology in the AW. When you
select the Use Compression option, this technology:
• Enables you to make use of an extremely powerful data storage and aggregation
algorithm that is optimized for sparse data
• Is often dramatically faster than any previous OLAP server technology when
aggregating sparse multidimensional data
• Can improve aggregation performance by a factor of 5 to 50
• Can reduce disk storage and can also improve query performance
This feature is ideal for large volumes of sparse data, but it is not suitable for all cubes. You
use this feature for the SALES cube in this lesson.
Note: Dimension order is unimportant when using compression. The multidimensional engine
automatically determines how best to physically order the data after it is loaded.
Also, if the Use Compression option is selected, then additional efficiency can often (but not
always) be achieved by marking all dimensions (including Time) as sparse, especially for
sparse data where there is known seasonality in the data, and especially if your AW is also
partitioned on Time.

Oracle Database 10g: Using OLAP 4-16


Using Global Composites
A composite is an analytic workspace object used to manage sparsity. It maintains a list of all
the sparse dimension-value combinations for which there is data. By ignoring the sparse
“empty” combinations in the underlying physical storage, the composite reduces the disk
space required for sparse data. When data is added to a measure dimensioned by a composite,
the AW automatically maintains the composite with any new values.
A “global” composite is simply a single composite for all data in a cube. Depending on the
Compression and Partitioning choices you make, the behavior of AWM will vary.
When to Specify “Use Global Composites”
The Use Global Composites option is rarely needed. It can be beneficial to select this option
in the case of a noncompressed cube that is partitioned.
In all other cases, you should leave the option unselected.

Oracle Database 10g: Using OLAP 4-17


Partitioned Cubes
You can easily partition your AW in AWM 10g by selecting the Partition Cube option. This is
another way of improving the build and aggregation performance and scalability of your AW,
especially if your computer has multiple CPUs.
Oracle Database 10g with the OLAP option can run on single-CPU computers and large
multi-CPU computers, and with Real Application Clusters and Grid technology. With Grid
technology, clusters of computers can be harnessed together and used as if they are one large
computer.
If you partition your AW, then when you submit the build process, you may choose to spread
the tasks of updating the various partitions across the available CPUs to get the job done
faster. Even when there is only a single CPU, partitioning often improves build and
aggregation performance because the partitioning allows AWM to process the cube in a series
of smaller steps. Also, by having to maintain smaller composite dimensions, overall efficiency
can improve.
Partitioning is often used together with other performance features (such as cube
compression), though these features do not have to be used together. For example, cubes that
are large, sparse, and running on powerful computers with multiple CPUs generally benefit
from the use of partitioning and compression. If data is relatively dense and the computer has
multiple CPUs, then using only partitioning is the best approach.
Oracle Database 10g: Using OLAP 4-18
Creating a Cube: Rules Tabbed Page
On the Rules tabbed page, you identify aggregation rules for the cube. You have many
different kinds of aggregations available. This is a powerful feature of Oracle OLAP, enabling
different dimensions to be independently calculated using different aggregation methods (or
not using aggregation at all).
In this example, the aggregation method of SUM is used. However, different aggregation
methods are available to you. For example, if you have costs and price data, you may want to
see this data averaged over time, answering such business questions as “What is the average
cost over 12 months?” or “What is the average price over 2 years?”

Oracle Database 10g: Using OLAP 4-19


Aggregation Methods
Analytic workspaces in Oracle OLAP provide great calculation flexibility for aggregation.
With Oracle OLAP, you have the option of preaggregating, aggregating on the fly, or partially
aggregating your cubes and measures. When data is presummarized, the summarized values
are physically stored. You also have the option to summarize data at query time.
It is common to set the aggregation rules only once for all measures contained in a cube.
However, when setting up the cube, you can specify that each measure can have its own
aggregation rules if required.
The default for aggregation is to use the SUM method (simple additive aggregation) for each
dimension. In the previous lesson, you accepted the defaults for aggregation. For cubes or
measures that have more sophisticated aggregation requirements, Oracle OLAP supports
several different methods of aggregation.
Note that you do not have to aggregate data. Some measures have no meaning at aggregate
levels of certain dimensions. In such cases, you can specify that the data is nonadditive and
should not be aggregated over those dimensions at all. Choosing the nonadditive aggregation
method means that when you view the data in the analytic workspace, you find data only at
the leaf levels of the dimensions for which you selected that method.

Oracle Database 10g: Using OLAP 4-20


Understanding Aggregation
AWM 10g enables you to set aggregation rules for each dimension independently for your
cubes and measures. That is, each dimension, if required, can use a different mathematical
method of generating data for the parent and ancestors.
Here are some examples:
• SUM simply adds up the values of the measure for each child value to compute the value
for the parent. This is the default (and most common) behavior.
• AVERAGE calculates the average of the values of the measure for each child value to
provide the value for the parent.
• LAST takes the last non-NA (Null) value of the child members and uses that as the value
for the parent.
Sales quantities and revenues are usually aggregated over all dimensions using the SUM
method, whereas inventory or headcount measures commonly require a different method
(such as LAST) on the Time dimension and SUM for the other dimensions. More advanced
aggregation methods, such as weighted average, are useful when aggregating measures such
as Prices (weighted by Sales revenue).

Oracle Database 10g: Using OLAP 4-21


Understanding Aggregation (continued)
When you define a cube, you identify an aggregation method. Any measures that you create
that belong to the cube automatically receive the aggregation methods for that cube. This is
the default, and it is one of the benefits of using a cube: By setting up aggregation rules and
sparsity handling for all the measures once at the “cube” level, you save time and reduce the
scope for errors or inconsistencies.
Different Aggregation for Individual Measures
However, you are not limited to specifying that all measures of a cube have the same
aggregation method. When adding measures to the cube, you can specify a different
aggregation method, and accept the defaults of all the other measure settings. For example, it
is not uncommon for a single cube to contain measures such as Sales Revenue, Sales Quantity,
Order Quantity, and Stock/Inventory Quantity. All these measures will aggregate using the
SUM method over all dimensions, except for the Stock/Inventory measure, which requires a
LAST method on the Time dimension (and SUM on all the others). Using the Rules tabbed
page, you can specify this kind of modification for the appropriate measure.
Note: The ability to override cube settings for individual measures is not supported in
compressed cubes. If you use compression, and one of your measures requires a different
aggregation method, you need to create it in a separate cube.
Oracle Database 10g: Using OLAP 4-22
Aggregation Operators
There are several different aggregation operators available to you for summarizing data in
your AW.
The following is a brief description of each of the operators.
• Average: Adds data values, and then divides the sum by the number of data values that
are added together
• Hierarchical Average: Adds data values, and then divides the sum by the number of
children in the dimension hierarchy. Unlike Average, which counts only non-NA
children, Hierarchical Average counts all the logical children of a parent, regardless of
whether each child does or does not have a value.
• Hierarchical Weighted Average: Multiplies non-NA child data values by their
corresponding weight values, and then divides the result by the sum of the weight
values. Unlike Weighted Average, Hierarchical Weighted Average includes weight
values in the denominator sum even when the corresponding child values are NA. You
identify the weight object in the Based On field.
• Weighted Average: Multiplies each data value by a weight factor, adds the data values,
and then divides that result by the sum of the weight factors. You identify the weight
object in the Based On field.

Oracle Database 10g: Using OLAP 4-23


Summarization Strategy for Aggregation
The amount of data that is preaggregated in batch as the data is loaded into the AW, and the
amount that is left to be summarized on the fly at query time, are balanced between fast build
and aggregation on the one hand and fast query performance and query scalability (many
simultaneous users querying the cube) on the other.
In general, the less you choose to presummarize when loading data into the AW, the more is
the load placed on run-time queries. In this scenario, queries are likely to be a bit slower and
the load on the server at query time is likely to be greater (for example, each user query is
likely to be asking the server to do more calculation at that moment). Precalculated summaries
are instantly available for retrieval and are generally faster to query.
However, it does not necessarily follow that full aggregation across all levels of all
dimensions yields the best query performance. In many cases, partial summarization strategies
are found to provide optimal build and aggregation performance with little noticeable impact
on query performance.
If you are using the compressed cube implementation, the advice on the following page is less
important because the engine automatically optimizes the storage and the aggregation strategy
to provide a very rapid summarization, continued excellent query performance, and a compact
AW in terms of disk space consumed.
Oracle Database 10g: Using OLAP 4-25
Run-Time Cache
Caching improves run-time performance in sessions that repeatedly access the same data,
which is typical in data analysis. Caching temporarily saves calculated values in a session so
that you can access them repeatedly without recalculating them each time.
You have two options:
• Cache run-time aggregations using session cache: This is the default behavior. This
option ensures that any run-time aggregations that are completed during a session are
cached for the remainder of the session, improving query performance as the session
progresses. This setting is ideal for a larger number of OLAP applications, namely those
that allow read-only analysis where the underlying data is not changing during a session.
• Do not cache run-time aggregations: Select this option if the cube would be subject to
what-if analysis and, therefore, it would be important that previously calculated
summarizations are not reused.

Oracle Database 10g: Using OLAP 4-27


Measures in Compressed Cubes
With normal storage, you can optionally override some of the cube-level settings for
individual measures that you create in the cube.
However, with compressed cubes, all measures must have:
• The same data type
• The same aggregation rules and summarization strategy
Apart from the new measure names, labels, and descriptions, all other measure settings are
inherited from the cube in which the measure is contained. You cannot override measure
settings for measures in a compressed cube.
Note: As stated previously, if you use compression and one of your measures requires a
different aggregation method, you need to create it in a separate cube.

Oracle Database 10g: Using OLAP 4-28


Aggregation and Multiple Hierarchies
Multiple Hierarchies
Although the AW used in this course uses one hierarchy per dimension, you can have multiple
hierarchies for a dimension. In the example in the slide, there are two separate hierarchies on
the Time dimension.
On the Aggregation Rules tabbed page, when creating a cube, you can specify which
hierarchy or hierarchies should be used for aggregation for that cube’s measures. You should
select one or more hierarchies for each dimension being aggregated. If you omit a hierarchy,
then no aggregate values are stored in it; they are always calculated in response to a query.
Because this may reduce query performance, generally you should omit a hierarchy only if it
is seldom used. The default behavior of AWM 10g is to select all hierarchies.

Oracle Database 10g: Using OLAP 4-29


Refreshing Data
You can refresh data at the AW, dimension, cube, and measure levels.
To refresh data for any of the listed objects, right-click the object and select the Maintain
option.

Oracle Database 10g: Using OLAP 4-31


Refreshing Data (continued)
When maintaining a cube or a measure, the default selection includes all dimensions. If you
know that there have been no changes to certain dimensions, and if you want to save the time
spent refreshing them unnecessarily, then you can remove them individually from the Selected
Target Objects list.
In the example, all measures in the Sales cube and the Customer dimension are maintained.

Oracle Database 10g: Using OLAP 4-32


Refreshing Data Options
The data processing options step in the Maintenance Wizard enables very specific processing
choices for both dimensions and cubes.
Each of the options for data processing is described in detail on the next page.

Oracle Database 10g: Using OLAP 4-33


Refreshing Data: Task Processing Options
The final step of the Maintenance Wizard enables you to control how and when the refresh
tasks happen. You can choose to run the task interactively and immediately from within the
AWM session. Or, you can submit the task to the Oracle Job Queue, where it can be run as a
background task, freeing up your AWM session for more work. Except for small tasks, doing
it via the Job Queue is generally recommended for this reason.
If you or your IT department prefers to schedule tasks like this in some other way, you can
save the task in the form of a script (which contains PL/SQL code) that can be run later. You
can save the script even if you are also submitting the task to be run immediately.
Running the task from within the AWM session is often the most convenient method,
especially when developing your AWs and when testing your processing. However, it is
unlikely to be the preferred method of scheduling the job after the system is running live in
production. Even during development and testing, the Job Queue has advantages.
Running the job via the Oracle Job Queue has two key advantages:
• The AWM session is not “locked” for the duration of the task (which, if you have a large
AW or a lot of summarization to do, could take some time).
• You can specify the number of parallel processes for the job to use. If you have
partitioned your AW, the time taken to refresh your AW can be significantly reduced,
assuming that sufficient resources are available on the computer.

Oracle Database 10g: Using OLAP 4-35


Reviewing the Build Log
After the loading of data, you can review the build log. The build log time-stamps the refresh
process. As each process starts and finishes, a description and time stamp are entered into the
log. Review the log to ensure that no errors are encountered.
All the maintenance logging goes into the XML_LOAD_LOG table, which belongs to the
OLAPSYS user. It does not matter whether you run the maintenance interactively in AWM, or
submit it to the Oracle Job Queue, or run the script that you saved in the final step of the
Maintain Wizard from some other process, such as your own PL/SQL program or a third-party
ETL tool or scheduler.
Technical Note
All the maintenance logging goes into the XML_LOAD_LOG table, which belongs to the
OLAPSYS user. This table can be reviewed later, if required.

Oracle Database 10g: Using OLAP 4-36


Summary
In this lesson, you learned how to implement user-defined attributes (such as gender) for a
customer dimension.
You learned about the difference between surrogate keys and natural keys when defining
dimension implementation details. You also learned that how you specify your cube
implementation can impact cube efficiency. Sparsity, compressed cubes, and cube partitioning
are options available for your cube implementation. The AWM tool offers you many different
aggregation methods for your cubes.
You learned how to refresh the AW. You can refresh an entire AW, or you can refresh cubes,
measures, and dimensions.

Oracle Database 10g: Using OLAP 4-37


Practice 4: Overview
In this practice, you build additional objects in your AW. You create a new Customer
dimension by using a template, a new Sales cube, and three measures belonging to the new
cube. You load data into the new objects in your AW.

Oracle Database 10g: Using OLAP 4-38


Objectives
In this lesson, you learn about some of the calculated measures that can be created in your
analytic workspace (AW) to enrich its analytic content for end users.
To organize your measures for the front-end tools, you learn how to create measure folders
and place measures into the folders.

Oracle Database 10g: Using OLAP 5-2


Calculated Measures
One of the powerful features of the Oracle OLAP technology is the ability to efficiently and
easily generate business calculations of data held in the database. Earlier, you saw that from a
relatively small number of basic raw numbers, such as units, price, and cost, business users
routinely report and analyze data via calculated measures and key point indicators. Some of
the calculations are simple; some of them are more involved. None are complex from an end-
user perspective, although many of them are challenging to traditional relational-only
databases. This is especially true when the calculations are numerous, and when many of the
queries are ad hoc and unpredictable in nature.
Oracle OLAP contains a powerful calculation engine. You can extend the analytic content of
your AW by adding into it some useful business calculations as calculated measures.
Calculated measures are, as the name suggests, calculated from other measures available in
the AW. They are implemented as formulas in the AW; that is, their definition is saved, but no
calculated data is stored. The calculations happen at run time when a user’s query requires it
(either for display or for use in a dimension’s selection). Calculated measures are derived
from the contents of other measures, including stored measures as well as measures that are
calculated at run time.

Oracle Database 10g: Using OLAP 5-3


Calculated Measures and Inherited Dimensionality
In the example shown in the slide, the Revenue calculated measure is illustrated. The
calculation in this example is simple: quantity × price.
Notice that the resulting dimensionality of Revenue is inherited from the two measures
involved in the calculation. When you use measures with different dimensionality in a
calculation, the result always contains the superset of the dimensions of the base measures.
The multidimensional data model handles this automatically. As a cube builder, you do not
have to worry about the possibility that different measures in your AW have different shapes
or dimensionality. You specify the calculation rule in the wizard, and the engine automatically
resolves the dimensionality. One requirement is that one dimension must be in common for
the result to make sense.
Quantity is dimensioned by Time, Product, and Customer, whereas Unit Price is not
dimensioned by Customer. When Oracle OLAP is asked to calculate quantity × price, it uses
its knowledge of the dimensional model to automatically handle the calculation of Revenue
for all customers, even though there is no separate price stored for each customer. If there is
not a separate price for each customer, then there must be a single price for all customers.
Price does not vary by customer.
As Oracle OLAP performs the calculation quantity × price, it applies the appropriate price for
the particular product and time dimension intersections being calculated.
Oracle Database 10g: Using OLAP 5-5
Creating a Calculated Measure
To create a calculated measure using the AWM 10g tool, right-click the Calculated Measures
node in the navigator, and then select Create Calculated Measure to access the Calculation
Wizard. You simply follow the steps in the wizard.
You can create a calculated measure in a variety of Oracle OLAP tools. For example, the same
user interface is available in OracleBI Spreadsheet Add-In, Discoverer Plus OLAP, and any
application or tool developed with OracleBI Beans, including a number of Oracle partner
products. This common user interface means that once you have learned the Calculation
Wizard here, you will be able to use the same feature in a variety of other Oracle Business
Intelligence tools and applications without additional training.
Use the Calculation Builder in AWM when you want the calculated measures that you define
to be available to authorized users of the AW, regardless of the access tool or method.

Oracle Database 10g: Using OLAP 5-6


Calculation Templates in AWM 10g
The first step in the Calculation Builder Wizard is to select the type of measure that you want
to create. There are a wide range of templates covering most common business calculations,
grouped into folders (as shown in the slide).
Click the measure type that you want, and then click Next to complete the template for your
chosen calculation type in step 2 of the wizard.
The calculations are expressed in business terms, so it is easy to choose the correct template.
Full descriptions of all the various calculation types are available in Help for this step in the
wizard.
In each case, step 2 provides you with an easy-to-use form that enables you to complete the
definition of your chosen calculation. No coding or technical skills are required. In the
following sections, you see examples of how to build these calculated measures into your AW:
• Share
• Percentage difference from a prior time period
• Moving average

Oracle Database 10g: Using OLAP 5-7


Creating a Share Calculation
The template for a share calculation is found in the Advanced Arithmetic calculation type
folder. A share calculation is a commonly used business metric that indicates the relative
importance of different products, customers, suppliers, and organizations to the business.
With the Share calculated measure template, you can create a calculation that gives the ratio
of a measure to the same measure value for another level or dimension member in the same
dimension.
Example
In the example, the share calculation returns the ratio of budget profit for any product
dimension member as a percentage of the total product.

Oracle Database 10g: Using OLAP 5-8


Share Calculation: Example
Here is an example of a report showing the Budget Profit base measure and three Share
calculations: Share of Product Total, Share of Product Level, and Share of a Product Member
(Hardware).
Note how the “% of Total,” “% of Level,” and “% of HW ” (hardware) category measures
behave differently as the user drills down the product hierarchy.
Also note that the third share measure on the report is base-lined to a specific product: the
Hardware category. The report shows how Hardware compares to the other categories:
Electronics, Peripherals and Accessories, Photo, and Software/Other.

Oracle Database 10g: Using OLAP 5-10


Creating a Percentage Difference from a Prior Period Calculation
Using the “Percent Difference from Prior Period” calculated measure template, you can create
a calculated measure that is useful to indicate growth or decline of a business over time. This
calculation template is found in the Prior/Future Time Period calculation type folder. This
template accepts input for the following items to calculate the percentage difference from a
prior period:
• Measure: Select a measure or a dimension member for which you want to calculate the
percentage difference from the prior period.
• Over: If there is more than one time dimension, then a box appears to enable the
selection of the proper Time dimension. Otherwise, the default Time dimension is used.
• In: Select the hierarchy for the specified dimension.
• From: Choose one of the following items to indicate the previous time period that the
comparison is to be based on:
- Year ago: Use if your measure is to compare performance with the same time
period from the previous year
- Period ago: Use if your measure is to compare performance with the previous
period at the same level in the Time hierarchy
- Number of periods or years ago: Use if your measure is to calculate a comparison
with a time period of a specified number (entered in the number box) of periods
ago, at a particular level (such as Year, Quarter, or Month)
Oracle Database 10g: Using OLAP 5-11
Percentage Difference from a Prior Period: Example
The example shown in the slide is a report that contains some same calculations of percentage
differences from prior periods.
All the measures automatically handle the situation in which the user needs to drill down into
the time dimension and look at time periods at different levels. A single calculated measure in
the AW can be used at any level of time, by any query tool, including SQL tools.
Note the following:
• The Last Year calculation works at all levels of time, and compares each time period
with the same time period 1 year ago.
• The Last Period calculation works at all levels of time, and compares each time period
with the previous period at the same level.
• The 3 Months Ago calculation works at the appropriate levels of time (in this case,
Month and Quarter because a quarter is made up of three months), and compares each
time period with the same time period 3 months ago (which is equivalent to one quarter
ago).
• Similar calculations can be easily generated for Costs, Quantity, Profit, and Budget
measures.

Oracle Database 10g: Using OLAP 5-12


Creating a Moving Average Calculation
The Moving Average calculated measure template enables you to create moving averages over
any of the measures in your AW. Moving averages are very useful when you analyze volatile
data, because they smooth out the peaks and troughs and enable you to more easily visualize
the trend in data. In the Moving Average template, you are asked to provide the following
input:
• Measure: Select the measure for which you want to calculate a moving average.
• Over Time In: If there is more than one time dimension, then a box appears to enable
the selection of the proper time dimension. Otherwise, the default time dimension is
used. In identifies the hierarchy for the specified dimension.
• Include Previous: Enter the number of periods to be used for the calculation.
An example of this calculation is as follows:
Moving average of sales for the last three months = (Jan sales + Feb sales + March sales) / 3
Note: Similar pages are used for Moving Totals, Moving Maximums, and Moving Minimums.

Oracle Database 10g: Using OLAP 5-13


Moving Averages: Example
Here is an example of a combination graph showing how moving averages can be a useful
way of smoothing out volatile data, thus enabling you to see the trends in data more easily.
One line is a moving six-month average, and the other line is a three-month average.

Oracle Database 10g: Using OLAP 5-14


Completing the Calculation Templates
In the final step of creating a calculated measure, provide the calculation with a name and a
user-visible description that end users will understand when they see it in the Query Builder of
their end-user application.
In the example shown in the slide, the definition of the Share calculation that is examined
earlier in this lesson is completed.
Note: Long labels are used by most OLAP clients for display. If you do not specify a value for
the long label, then it defaults to the calculation’s name.

Oracle Database 10g: Using OLAP 5-15


Modifying Calculated Measures
Existing calculated measures can be edited from within AWM 10g. The descriptions and the
calculation details can be changed.
To change a calculated measure, click the calculated measure in the Model view. You see the
general information displayed on the right. You can:
1. Make changes to labels and description. You can change the labels and description, but
not the name.
2. Click the Launch Calculation Editor button to change the details of the calculated
measure. You can change the details, but not the type, of the measure.

Oracle Database 10g: Using OLAP 5-16


Using Measure Folders
Measure folders are used to group measures together for easier end-user access. This includes
stored measures and calculated measures.
When using the Oracle OLAP Query Builder (in Discoverer Plus OLAP, OracleBI
Spreadsheet Add In, OracleBI Beans, AWM, and other tools), measure folders make it easy to
find the required measure from a list of potentially tens, hundreds, or even thousands of
measures in the AW.
Without measure folders, measures are simply listed in a long list. It is recommended that you
use this feature to improve the end-user experience.

Oracle Database 10g: Using OLAP 5-17


Creating Measure Folders
To create a measure folder, perform these steps:
1. Right-click the Measure Folder node in the navigator, select Create Measure Folder.
2. Enter a name for your measure folder, and an optional description.
3. Select the measures that you want grouped together in the measure folder from the
Available Measures list, and then move them to the Selected Measures list.
4. Click Create.
The same measure can appear in multiple measure folders, which means that you have
flexibility over how you arrange your measures for users.
Some examples of the design of a measure folder include:
• By kind of measure: Base Measures, Time Series Measures, Shares and Indexes, and so
on (as shown in this lesson)
• By usage: Profitability Analysis Measures, Supply Chain Analysis Measures, Financial
Reporting Measures, Measures for Performance Against Target, and so on.

Oracle Database 10g: Using OLAP 5-18


Summary
In this lesson, you learned how you can easily define calculated measures with the AWM
wizard interface. There are many different functions for your calculated measures to use,
enabling you to build robust calculations for your end users.
You also learned how to create measure folders and organize measures in them.

Oracle Database 10g: Using OLAP 5-19


Practice 5: Overview
In this practice, you add calculated measures to your AW.
Calculated measures created using the Calculation Wizard include the following:
• Budgets Cube: Budget Cost, Budget Profit %, Budget Profit % Parent Prod (Share)
• Sales Cube: Profit, Profit %
Calculated measures created using the templates include:
• Budgets Cube: Budget Profit Last Year, Budget Profit Last Year Dif, Budget Profit Last
Year %, Budget Profit YTD, Budget Profit % Total Prod (Share), Budget Sales Last
Year, Budget Sales Last Year Dif, Budget Sales Last Year %, Budget Sales YTD
• Sales Cube: Cost vs Budget, Profit vs Budget, Sales vs Budget, Profit Last Year, Profit
Last Year Dif, Profit Last Year %, Profit YTD, Sales Last Year, Sales Last Year Dif,
Sales Last Year %, Sales YTD, Avg Sales Price
Finally, you create the following measure folders to organize your measures:
• Base Measures
• Shares And Indexes
• Time Comparisons Last Year
• Variances
• Year To Dates
Oracle Database 10g: Using OLAP 5-20
Objectives
In this lesson, you learn to use OracleBI Spreadsheet Add-In to quickly and easily create
OLAP-focused worksheets directly in Microsoft Excel and extend the power of worksheets
by using existing Excel capabilities. With OracleBI Spreadsheet Add-In, you can directly
access data in the analytic workspace (AW) through the Excel interface.
Using Excel and OracleBI Spreadsheet Add-In to access the AW that you created in the
previous lesson, you learn to choose data from a list of values, create advanced selections,
and select top/bottom and hierarchy-based values.

Oracle Database 10g: Using OLAP 6-2


Using OracleBI Spreadsheet Add-In
OracleBI Spreadsheet Add-In is part of the Oracle Business Intelligence Tools CD set. When
installed, you automatically have access to OracleBI Spreadsheet Add-In through Excel. In
Excel, the OracleBI menu gives you access to query and view data from an OLAP data
source.
Note: If the OracleBI menu is not available, you can add it through the Add-Ins submenu of
the Excel Tools menu. Click the Browse button in the Add-Ins window. The executable file
for the Excel add-in is located in the BIToolsHome\oraolapxl folder. The name of the
add-in file is OLAP4XL.xla.

Oracle Database 10g: Using OLAP 6-3


Connecting to an Oracle OLAP Data Source
When you install OracleBI Spreadsheet Add-In, a new menu item named “OracleBI” is
added to the Excel menu bar. Use this menu to access features that interact with Oracle
OLAP, and also to connect to the OLAP data source.
To connect to an AW data source, perform these steps:
1. Select OracleBI > New Query to display the Connect (Oracle OLAP Data Source)
dialog box.
2. In the Connect (Oracle OLAP Data Source) dialog box:
- Use the OLAP Connection tabbed page to specify the username and password
and to connect to an OLAP data source.
- Use the Connection Editor tabbed page to create a new OLAP data source
connection.
3. On the OLAP Connection tabbed page, enter your username and password.
4. On the Connection Editor tabbed page, enter an appropriate connection description,
and then specify the host name, port number, and SID for your OLAP connection.
5. Click Connect.

Oracle Database 10g: Using OLAP 6-4


Using the OLAP Query Wizard
When you connect to an OLAP data source, the Oracle OLAP Query Wizard is
automatically opened. This wizard enables you to specify the content and layout of your
OLAP query.
You can also access the Oracle OLAP Query Wizard by opening an existing OLAP
worksheet and selecting Edit Query from the OracleBI menu.
Using the Oracle OLAP Query Wizard, you can:
• Specify the measures and dimensions to include in the query
• Determine the layout in which data and labels are organized in the query
• Select dimension members for each dimension in the query:
- Select dimension members from a list.
- Specify conditions that return a set of dimension members.
- Choose a set of dimension members that have been previously saved.
- Create saved selections. The OLAP Query Wizard makes it easy to reuse
dimension selections by enabling users to save and retrieve defined selections.
The next few sections cover how to create a product-ranking report to return the top five
products based on Budget Revenue.

Oracle Database 10g: Using OLAP 6-5


Selecting Measures
In the Items step, select the measures that you want to display.
The Available list contains all the measures and dimensions that can be displayed in your
worksheet. In SALES_AW, you previously created five measure folders. Expanding a
measure folders displays the measures and the dimensions within the folder.
To choose measures for your spreadsheet, select the desired measure or measures, and then
click the Add Selected Item button (>) to move the selected items to the Selected list.
In the example, the Sales measure and its related dimensions are moved to the Selected list
because the Automatically Add/Remove Dimensions check box is selected.
If you want to remove a dimension from analysis in the final report, click the dimension
name, and then click the Remove Selected Item button (<). In this example, all dimensions
are displayed in the final report.

Oracle Database 10g: Using OLAP 6-6


Specifying a Layout
In the Layout step of the wizard, you can change the layout of data by performing the drag-
and-drop operation on the appropriate dimension or measure tiles.
• To swap dimensions interactively, drag the dimension tile that you want to swap over
the dimension tile to which you are swapping. When the dimension name changes
color, drop the dimension. An example of this technique is shown in the lower-left
image in the slide, where the Product and Customer dimensions are swapped.
• To move a dimension, drag the dimension to the desired edge location. When you see a
black box next to the edge location, drop the dimension.
• Alternatively, right-click the dimension that you want to move or swap. From the
submenu choose the action, and then choose the dimension to which you are swapping
or moving.
When you have the layout that you want, click Next to continue in the wizard.

Oracle Database 10g: Using OLAP 6-7


Specifying Dimension Members
In the next several steps of the Query Wizard, select the dimension members for each
dimension in the query. In this example, the Time dimension is displayed first.
On the Members tabbed page of the Available list, you can use the drill symbol (+) to show
the next level of values in the dimension hierarchy. In the example, the four quarters of 2005
are selected in the Available list.
The Add Item button (>) is used to move the values to the Selected list.
Click Next to continue specifying dimension member for each dimension in the query. Or,
you can click Finish without specifying dimension members. If you click Finish, a default
selection for each of the remaining dimensions is used in the query.

Oracle Database 10g: Using OLAP 6-8


Using Conditions
You can use the Conditions tabbed page to select and customize conditions that become
steps to narrow the scope of a query. The Conditions tabbed page provides examples of
various types of conditions. You modify the examples to create the exact condition that you
want for a step in a query. The condition categories are the following:
• Exception: Conditions that select members by using comparisons of values for
measures. Sample conditions are “Sales > Cost” and “Sales <= Cost + 10%.”
• Top/Bottom: Conditions that select the specified number of members after ranking the
members by the specified measure. You can specify an exact number of members or a
percentage of the total members. Sample conditions are “Top 10 based on Sales” and
“Top 5% based on Cost.”
• Hierarchy: Conditions that select members on the basis of hierarchical relationships,
such as family members and levels. A sample condition is “Children of Regions of the
World.”
• Time/Ordinal: Conditions that select members on the basis of ranges of time and on
hierarchical levels. A sample condition is “From July 2004 to December 2005.”
• Match: Conditions that select members on the basis of matches with text strings and
attribute values. A sample condition is “Name contains <xyz>.”

Oracle Database 10g: Using OLAP 6-9


Using Conditions to Rank Values
To create a condition, click the Conditions tab in the Available list. The Conditions tabbed
page provides condition templates that are organized into condition types. The condition
templates can be customized to specify the condition that you require.
In the slide example, the Top/Bottom folder is opened and the “Top 10 based on Sales”
template is selected. The condition templates derive some of their default values directly
from the current query—in this case, Budget Revenue is read directly from the current
query.
Each element of the condition that is displayed as a hypertext link may be modified. For
example, this condition is modified to return the top five products, by clicking the “10”
hyperlink and changing it to “5.”

Oracle Database 10g: Using OLAP 6-10


Using Conditions to Rank Values (continued)
You can use a condition as the only step for a dimension selection, or you can add it as a step
in a multistep selection.
You can also modify elements that are displayed as hypertext links when the condition is
moved to the Selected list. In the example, the condition is added to the Selected list as a
second step by using the Add Selected Items button (>). Then, the “Add” hypertext link is
clicked, and the “Then Keep” option is selected from the list. The completed condition reads
as follows:
Keep Product: Top 5 based on Sales
Multistep Query Model
A dimension selection may be any combination of Member, Condition, or Saved Selection
steps. In the example in the slide:
• The Peripherals and Accessories category is selected from the Members list.
• Then, a ranking condition is added as the second step.
All multistep selections are evaluated in a top-down fashion. Therefore, this condition
returns the top five products in the peripherals and accessories category, based on sales.
If “Add” was not changed to “Then Keep,” the top five products for the entire dimension
would be returned in addition to the Peripherals and Accessories category member.
Oracle Database 10g: Using OLAP 6-11
Qualifying Ranking Conditions
Click Edit Step (pencil icon) to display the Edit Step dialog box. In the Edit Step dialog box,
you can view all elements of the condition in one place. The example in the slide displays
the Action field, which shows the Keep option, the Level field, which indicates the hierarchy
level (in this case, the Product level), and so on. Any of these fields can be modified.
Qualify the Condition
You can also specify the values on which you want to base your condition for each of the
other dimensions in the query. In the example, the Edit Step dialog box displays the default
qualification of the other dimensions: Q1-2005 (Time), Americas (Customer), and Channel
Total (Channel).
To change the current dimension qualification, click the Qualify button to display the
Qualify Measure dialog box. In the example, the Time dimension is qualified to 2005, and
the Customer dimension is qualified to Each Customer. Click OK in the Qualify Measure
dialog box to update the values that are displayed in the For box of the Edit Step dialog box.
Note: The Each <Dimension> option is available only for dimensions that are displayed in
the page axis of the report. This option enables a ranking or exception condition to
dynamically reexecute when a new member is selected from that page axis in the report.

Oracle Database 10g: Using OLAP 6-12


Completing the Dimension Selection
In the example in the slide, the final dimension in the query is displayed in the Query
Wizard. The Channel Total, Direct, Indirect, and Others members are selected for the
Channel dimension.
After completing all steps in the Query Wizard, click Finish. The report is then generated in
Excel.

Oracle Database 10g: Using OLAP 6-13


Viewing the Report
The OLAP query returns data for the top five Peripherals and Accessories products based on
Sales, for 2005, Channel Total, and each Customer.
You can select a new dimension member from each of the Page Axis dimension pull-down
lists to requery the data.
You can also drill down on any dimension member that contains a drilldown symbol (+) next
to it. Because the Product selection for this report contains only leaf-level data, there are
only drilldown symbols in the Time dimension. After they are drilled down, you can
collapse a set of dimension members back to the parent level by clicking the collapse
symbol (-).

Oracle Database 10g: Using OLAP 6-14


Using the Report
Selecting Members from the Page Axis Dimensions
In the top example in the slide, Europe is selected from the Customer dimension. Because
the Customer dimension has been qualified for each member, the Product ranking condition
is reevaluated each time you select a new dimension member from the Customer dimension.
Notice the change in the Product ranking order.
Drilling Up or Down
On the basis of the dimension values that you choose for your report, you have the ability to
drill up or down on the data. The query is automatically reexecuted, and the correct list of
top five products based on budget revenue is displayed.
In the bottom example in the slide, the first quarter of 2005 is drilled down to show the first
three months of 2005. The report is refreshed with the new data for the ranking report.
Note: Although the report now shows new data for the months, the ranking itself remains the
same because the condition specified that the ranking should be based on data for 2005.

Oracle Database 10g: Using OLAP 6-15


Saving the Report
To save the report based on data in the AW, you use the usual Excel file-saving command.
The report is saved as an Excel spreadsheet. When you open the saved report, you see the
data as a snapshot of what you last saved.
To update the report to the latest values in the AW, you must reconnect the query. Select the
Reconnect Query option in the OracleBI menu. After you are reconnected, the report is
updated with the latest data from the AW.

Oracle Database 10g: Using OLAP 6-16


Modifying a Query
You can modify an existing OLAP query by selecting OracleBI > Edit Query. The Oracle
OLAP Query Editor then appears.
You can use the four tabbed pages to modify different criteria for your query:
• Use the Items panel to select measures, dimensions, and hierarchies for a query.
• Use the Layout panel to rearrange data in the spreadsheet.
• Use the Dimensions panel to qualify dimension values for a query.
• Use the Hidden Dimensions panel to select a new member for a hidden dimension.
Hidden dimensions are dimensions that are related to the selected measures of a query
but are not shown in a report after the query is executed. One member of each hidden
dimension is applied to the query.
Note: The Edit Query option is available only when a cell containing an existing query is
selected.

Oracle Database 10g: Using OLAP 6-17


Modifying a Query: Results
In the sample results in the slide, the Edit Query window is used to perform the following:
• On the Items tabbed page, add the Profit and Profit % calculations from the Base
Measures folder.
• On the Layout tabbed page, swap Time and Measures on the column axis of the report.
• On the Dimensions tabbed page:
- For Time, change the selection to the year 2005.
- For Product, edit the ranking condition and use the Qualify button to select Each
Channel (in addition to Each Customer) as qualifying values for the other
dimensions in the query.
Note
• The Profit % measure is formatted using the Excel Add Decimals tool.
• When you select a Channel or Customer member from the page axis in the report, the
product-ranking condition is reevaluated.
• The product ranking based on Sales may be different than if the ranking was based on
other measures, such as Profit, Profit %, or any other measure that is not in the report.

Oracle Database 10g: Using OLAP 6-18


Inserting an Excel Chart Based on OLAP Data
You can insert an Excel chart that is based on the OLAP data in your spreadsheet. Then,
when you select new data for the spreadsheet, the chart updates automatically along with the
crosstab.
To insert a chart based on OLAP data, perform the following steps:
1. Select the crosstab elements that you want to be displayed in the chart. In the example,
the Product dimension, column headings, and data body are selected.
2. Select Chart from the Insert menu.
3. In the Chart Wizard, specify Chart Type, Data Range, Series, and any other layout
options, and then click Finish.

Oracle Database 10g: Using OLAP 6-19


Using the Excel Chart
Because the chart is driven by the same OLAP query as the crosstab, when you change
dimension selections, the chart updates automatically along with the crosstab.
Notice that the chart is based on the Sales measure. In the Chart Wizard, you can select any
measure from the query as the series.

Oracle Database 10g: Using OLAP 6-20


Applying Excel Formatting to OLAP Data
Using Excel formatting options, you can format the sheet, cells, rows, and columns.
In the example in the slide:
• All columns in the data body are formatted with two digits after the decimal place.
This can be accomplished by selecting the entire data body, and then using the Format
Cell window, or by using the Format Style and Increase Decimal tools.
• In addition, a conditional format is added to the Profit % columns. To open the
Conditional Format dialog box, select Format > Conditional Formatting from the
menu. The conditional format specifies that all values below 20% be shown in red.

Oracle Database 10g: Using OLAP 6-21


Creating an OLAP Calculation in Excel
All three of the OLAP-enabled Oracle Business Intelligence tools (OracleBI Spreadsheet
Add-In, Discoverer Plus OLAP, and OracleBI Beans) share the same functional ability to
create calculations as does Analytic Workspace Manager (AWM) 10g. The same OLAP
Calculation Wizard is shared by all products.
To launch the Calculation Wizard from Excel, select OracleBI > New Calculation from the
menu.
Store Calculations in the AW or with the Tool?
When calculation definitions are created by AWM 10g, they are stored directly in the AW. In
this case, the calculation is centrally located and managed as part of the data model, and is
available to all OLAP tools and application users that can access the AW schema.
When you create an OLAP calculation in Excel, the information is saved with the
spreadsheet. If you distribute the spreadsheet, the calculation is available in Excel to any
individual who connects to the same data source.

Oracle Database 10g: Using OLAP 6-22


Customizing Default Options
You can customize several options by using Default Options in the Spreadsheet
Add-In menu.
The options are divided into three categories: General, Query, and Hierarchies. Each is
shown on a separate tabbed page.
For each category, you can select different options.
• On the General tabbed page, you identify options for creating queries.
• On the Query tabbed page, you specify settings for displaying data.
• On the Hierarchies tabbed page, you identify the formatting of values in a dimension
that has a hierarchy.

Oracle Database 10g: Using OLAP 6-23


Summary
OracleBI Spreadsheet Add-In enables you to display and navigate Oracle OLAP data from
Excel.
You can treat Oracle OLAP data as regular Excel data—for example, you can create
formulas and graphs, or apply Excel formatting. This enables you to combine the powerful
analytic capabilities of Oracle OLAP with standard Excel functionality.
Using a wizard-driven interface, you can select data from an AW by choosing from a simple
list of values or by creating advanced selections. For example, you can create value-based
exceptions and top/bottom or hierarchy-based values.
You can use OLAP calculations that are stored in the AW or create your own personal OLAP
calculations using the Calculation Wizard that is accessible from the OracleBI menu.

Oracle Database 10g: Using OLAP 6-24


Practice 6: Overview
In this practice, you use OracleBI Spreadsheet Add-In in Excel to query data in the analytic
workspace that you created in the previous lessons.
You create two reports:
• The first report uses the product share calculations for Budget Profit, which show the
target contribution of each product member to the parent of each product and to total
product.
• The second report incorporates a ranking condition in the query that enables ranking
analysis of products. You insert an Excel chart that provides a graphical presentation of
the OLAP data.
Note: If the OracleBI menu item is not available, you can add it from the Add-Ins submenu
of the Excel Tools menu. Click the Browse button in the Add-Ins window. The executable
file for the Excel add-in is located in the BIToolsHome\oraolapxl folder. The name of
the add-in file is OLAP4XL.xla.

Oracle Database 10g: Using OLAP 6-25


Objectives
In this lesson, you use OracleBI Discoverer Plus OLAP to create worksheets that enable
analysis of OLAP data. Using the analytic workspace (AW) and its multidimensional objects
that were created in previous lessons, you learn how easy it is to interact with and build
analytical reports that are based on analytic data that you created in the AW.
Many of the same wizard interfaces to the data in the AW are shared with OracleBI
Spreadsheet Add-In. This illustrates the consistency of user experience across all OLAP-
enabled tools in the Oracle Business Intelligence suite.

Oracle Database 10g: Using OLAP 7-2


OracleBI Discoverer Components
OracleBI Discoverer Plus OLAP is part of the Oracle Business Intelligence suite. The Oracle
Business Intelligence suite contains four components of the OracleBI Discoverer product
offering.
OracleBI Discoverer Plus OLAP and OracleBI Discoverer Plus Relational
Oracle Database 10g provides analytic services for both multidimensional and relational
data sources. OracleBI Discoverer Plus enables users to create reports, perform ad hoc
querying, and engage in sophisticated analysis of multidimensional and relational data
sources.
• Discoverer Plus OLAP can be used against analytic workspace data and data
warehouse schemas in star or snowflake form.
• Discoverer Plus Relational can be used against any relational schema.
OracleBI Discoverer Viewer
Using Discoverer Viewer, end users can view, change, and save reports that are created with
Discoverer Plus (OLAP and Relational). As a thin HTML client, Discoverer Viewer results
in smaller footprint on the hardware, and therefore can support more concurrent users.
OracleBI Discoverer Portlet Provider
Discoverer Portlet Provider enables users to publish Discoverer portlets integrated in a
portal, along with content from other sources.
Oracle Database 10g: Using OLAP 7-3
OracleBI Discoverer Plus OLAP
Using OracleBI Discoverer Plus OLAP, users can leverage the Oracle OLAP engine to
perform query and analysis against Oracle OLAP data sources, including analytic
workspaces.
Discoverer Plus OLAP enables direct access to the power of the Oracle OLAP analytic
engine while providing ease of use through the award-winning Discoverer user interface.
This combination makes the Oracle OLAP option easily accessible to both power users and
casual users.
Creating Workbooks of OLAP Data
With Discoverer Plus OLAP, users create workbooks of OLAP data. OLAP workbooks
contain reports of multidimensional data in both crosstab and graph views. A workbook may
contain one or more reports, which are called worksheets.

Oracle Database 10g: Using OLAP 7-4


Distributing OLAP Analytics
Discoverer Plus OLAP workbooks may be published for viewing and analysis by the larger
Discoverer user community, thus providing for easy distribution of analysis across the
enterprise.
Viewing Discoverer OLAP Workbooks in Pure HTML
Discoverer Viewer users can view, change, and save reports that are created with Discoverer
Plus OLAP.
Discoverer Viewer contains many features to view and analyze reports, such as drilling,
pivoting, and exporting data and graphs into a variety of industry-standard formats (such as
XML, CSV, PDF, IQY, and Microsoft Excel). It also enables high-fidelity printing and
enhanced formatting features. In addition, you can use Discoverer Viewer to send
Discoverer reports as e-mail attachments.
Publishing Discoverer OLAP Portlets
OracleBI Discoverer is integrated with Oracle Application Server Portal (OracleAS Portal).
This integration enables Discoverer content (including live access to Discoverer Plus OLAP
reports) to be published on enterprise portals so that the business intelligence content can be
shared with a wide spectrum of users: customers, company executives, partners, and so on.
Oracle Database 10g: Using OLAP 7-5
Connecting to Discoverer Plus OLAP
The officially supported way to connect to Discoverer Plus OLAP is through the Connection
Manager. However, because Discoverer Plus OLAP is an applet, a desktop icon that directly
accesses the applet has been created for this course.
Connection Manager
To display the Discoverer Plus connection window, enter the URL for Discoverer Plus in the
address line of your browser. The URL uses the following format:
http://<application server host name>:<port number>/discoverer/plus
In the Discoverer Plus connection window, select OracleBI Discoverer for OLAP, enter the
appropriate connection authentication information, and then click Go.
Discoverer Plus OLAP Applet
In this course, you directly launch Discoverer Plus OLAP by double-clicking the desktop
icon. In the Connect dialog box, enter the appropriate connection information, and then click
Connect.

Oracle Database 10g: Using OLAP 7-6


Creating a Workbook and Worksheet
Recall that Discoverer Plus OLAP analytic reports are called worksheets and that
worksheets are organized into containers called workbooks. After the connection to a
Discoverer Plus OLAP data source is made, the Workbook Wizard is automatically
displayed. Using the Workbook Wizard, you can open an existing workbook or create a new
workbook.
To create a new workbook, perform these steps:
1. In the Workbook Wizard, select the “Create a new workbook” option.
2. Select the options to display the appropriate worksheet items.
Worksheet Items
The data display region of the worksheet may include a crosstab, a graph, or both. If you
choose only a crosstab or a graph, you can display the other presentation later.
You can select the following options to provide more information in the worksheet:
• Title: Provides a text-entry area above the report for a title
• Page Items: Displays tiles for page-item dimensions in the query
• Text Area: Provides a text-entry area below the report for a footer
Note: The graphical example updates to reflect your latest worksheet item selections.
Oracle Database 10g: Using OLAP 7-7
Selecting Measures in the Wizard
In step 2 of the Workbook Wizard, select the measures for your report. This is the same
interface that you used in OracleBI Spreadsheet Add-In.
Select measures in the same way that you did with OracleBI Spreadsheet Add-In:
1. From the Available list, select the appropriate measures.
2. Click Add Selected Items (>) to move the measures to the Selected list.
Click Finish or Next?
At this point in the wizard, you have two choices:
• Clicking Next enables you to specify a layout for the crosstab and then continue in the
wizard to select members for each dimension in the query, just as you have done in
OracleBI Spreadsheet Add-In.
• Clicking Finish exits the wizard and creates the report by using a default layout and
default set of dimension member selections.

Oracle Database 10g: Using OLAP 7-8


Specifying a Report Layout in the Wizard
In the Workbook Wizard, you can modify the default layout of the report by using drag-and-
drop techniques on the dimension tiles or measures, or by right-clicking.
This is the same wizard step that you used with OracleBI Spreadsheet Add-In.

Oracle Database 10g: Using OLAP 7-9


Specifying Dimension Member Selections in the Wizard
As you learned using OracleBI Spreadsheet Add-In, the creation of an OLAP query includes
the selection of members for each dimension in the query. The same query wizard steps that
are used for dimension member selection in OracleBI Spreadsheet Add-In are used in
Discoverer Plus OLAP.
For each dimension, you can specify a selection by choosing members using one of the
following tabs:
• Members: Use the Members tabbed page to display a list of members for the
dimension. Select the members that you want to include in the query.
• Conditions: Use the Conditions tabbed page to create a condition to be evaluated. The
dimension members that are returned by the condition are used in the query.
• Saved Selections: Use the Saved Selections tabbed page to apply a saved dimension
selection.

Oracle Database 10g: Using OLAP 7-10


Examining the Discoverer Plus OLAP Work Area
The Discoverer Plus OLAP worksheet environment enables interactive modification and
formatting of reports. There are three primary regions in the worksheet environment:
1. Menu bar, Standard toolbar, and Formatting toolbar: Provide access to all of the
features of Discoverer Plus OLAP
2. Available Items pane: Provides an interactive interface that enables you to modify
directly the query that is associated with the current worksheet. The Available Items
pane has two tabs: Members and Saved Selections.
3. Worksheet area: Displays the worksheets in the opened workbook. Only one
workbook can be opened at a time. A workbook may contain multiple worksheets.
A fourth region is, by default, not normally displayed:
4. Query Steps pane: Reflects the current state of the query item that is displayed in the
Available Items pane. The Query Steps pane is examined later in this lesson.

Oracle Database 10g: Using OLAP 7-11


Using the Available Items Pane
Using the Available Items pane, you can change a query directly, without using a dialog box
or wizard. Together with the Query Steps pane, it supports in-place analysis—you simply
select values (dimension members, measures, calculations, or saved selections) and move
them directly to the worksheet.
There are several ways to move items to the worksheet:
1. Drag the items directly to the crosstab or graph.
2. Right-click the items, and select Add or Replace from the pop-up menu.
3. Use the toolbar to move the items.
In the example in the slide, all quarter values for the year 2005 are selected. These members
may be moved to the worksheet by using one of the methods described above.
Add or Replace with the Drag-and-Drop Operation?
By default, dragging an item to the worksheet performs an Add action. However, when you
drag a saved selection to the worksheet, a Replace action is performed. Saved selections are
discussed later in this lesson.
Removing Items from the Worksheet
You can also remove report items by dragging them from the worksheet.
Oracle Database 10g: Using OLAP 7-12
Accessing the Edit Worksheet Wizard
Discoverer Plus OLAP uses the same query wizard that OracleBI Spreadsheet Add-In uses.
With OracleBI Spreadsheet Add-In, the query wizard is called the OLAP Query Editor
Wizard. In Discoverer Plus OLAP, it is called the Edit Worksheet Wizard.
To access the wizard, do either of the following:
• Click the Edit Worksheet button .
• From the menu bar, select Edit > Worksheet.
Use the Edit Worksheet Wizard in the same way that you use the OLAP Query Editor
Wizard in OracleBI Spreadsheet Add-In.

Oracle Database 10g: Using OLAP 7-13


Saved Selections
A saved selection is an object that contains a saved set of dimension members for an OLAP
query. You typically create a saved selection for dimension members that you frequently
reuse.
Creating Saved Selections
Using Discoverer Plus OLAP, you can create a saved selection in two ways:
• Using the Edit Worksheet Wizard
• Using the Save button that is displayed in the Query Steps pane
Reusable for Queries in Other Reports
When you use Discoverer Plus OLAP, saved selections are stored in the Discoverer Catalog.
The Discoverer Catalog is a repository in the Oracle database that enables storage and
sharing of analytic objects that you create with Discoverer Plus OLAP. A saved selection is
one of these objects.
Saved selections can thus be reused in queries that are part of other reports in the same
workbook as well as in other workbooks. The can also be shared with other Discoverer
users.

Oracle Database 10g: Using OLAP 7-14


Creating Saved Selections: Edit Worksheet
After you display the Edit Worksheet Wizard, click the Dimensions tabbed page, and then do
the following:
1. Choose the dimension.
2. Specify your dimension selection.
3. Click the Save button.
In the Save Selection As dialog box, perform the following steps:
1. Enter a name for the saved selection.
2. Select the appropriate option: Save Steps or Save Members. These options are
examined in the next section.
3. Click OK.
By default, the saved selection is stored in your private user folder in the Discoverer
Catalog.
Example
In the example in the slide, a Hierarchy condition is used to return the product items in the
Photo division, and the Save button is clicked. By selecting the Save Steps option, the
resulting selection is saved to the SH_AW user folder with the name Photo Cat Products.

Oracle Database 10g: Using OLAP 7-15


Creating Saved Selections: Edit Worksheet (continued)
You can stay in the Edit Worksheet Wizard and continue to create new saved selections
before executing a query.
Example
In the example in the slide, a second step has been added to the Photo category product
selection. This two-step selection is used to return the top 5 product items in the Photo
category.
You can create another saved selection for the Product dimension by clicking the Save
button.

Oracle Database 10g: Using OLAP 7-16


Understanding Saved Selection Options
As stated previously, in the Save Selection As dialog box, you must specify one of the two
options: Save Steps or Save Members.
Save Steps
The Save Steps option creates an object that records steps that result in dimension selection.
This object can be thought of as a dynamic saved selection. For example, if you create a
saved selection that contains a condition, you should choose this option. Each time the query
is run, the steps in the saved selection are reevaluated.
Save Members
The Save Members option creates a static list of values that are specified for the dimension
when the saved selection is created. Therefore, this object contains a list of dimension
members that never change.
Example
By selecting the Save Steps option, a dynamic reevaluation of the ranking condition is
enabled. Also, any new products that are added to the Photo category are considered in the
ranking condition. The saved selection’s name in this example indicates that the product
ranking condition is unqualified for the Time and Customer dimensions.
Oracle Database 10g: Using OLAP 7-17
Using Saved Selections
You can apply a saved selection to a report in one of the two ways:
• Use the Saved Selections tabbed page in the Available Items pane.
• Use the Saved Selections tabbed page on the Dimensions tabbed page of the Edit
Worksheet Wizard.
Applying a Saved Selection Interactively
You can apply a saved selection to the report directly from the Available Items pane without
having to open a wizard or dialog box. Perform these steps in the Available Items pane:
1. Select the Dimension that you want to change.
2. Click the Saved Selections tab at the top of the Available Items pane.
3. Navigate to the user folder.
4. Select and apply the appropriate saved selection to the worksheet.
Example
In the example in the slide, the Product dimension selection is modified by dragging the
“Photo Cat Products” saved selection to the worksheet area. This action replaces the
previous product selection.

Oracle Database 10g: Using OLAP 7-18


Undoing or Redoing the Previous Action
If you want to revert to a previous state in the worksheet (such as the previous dimension
selection), you can use the undo or redo functionality in Discoverer Plus.
There are two ways to perform an undo or redo operation:
• Select Edit > Undo (or Redo) <previous action>.
• Click the Undo (or Redo) button.
Multiple Actions
The user can undo (or redo) several actions, not only the latest (previous) one, by
performing the action multiple times.

Oracle Database 10g: Using OLAP 7-19


Removing Items from a Report
You can remove report items by simply dragging them from the worksheet. This includes
measures and dimension members.
Example
The crosstab shown in the slide is updated to reflect the product selection from the previous
page.
Notice the lack of sales revenue data for the 64MB Memory Card product. This item is
removed from the report by dragging it from the worksheet area, as shown in the slide.

Oracle Database 10g: Using OLAP 7-20


Viewing the Query Steps Pane
In OracleBI Spreadsheet Add-In, you must use the Query Editor to construct multistep
selections. You have the same option in Discoverer Plus OLAP, but in addition, the
interactive addition and removal of dimension members in a worksheet also records these
actions as steps for that dimension in the query.
You can view the recorded steps for any dimension by using either the Edit Worksheet
Wizard or the Query Steps pane.
To display the Query Steps pane, select View > Query Steps Pane from the menu.
Example
In the example in the slide, the removal of the 64MB Memory Card product (from the
previous slide) is automatically recorded as a step for the product dimension.

Oracle Database 10g: Using OLAP 7-21


Creating Saved Selections: Query Steps Pane
In addition to creating saved selections using the Edit Worksheet Wizard, you can create
saved selections by using the Query Steps pane.
To create a saved selection using the Query Steps pane, perform the following steps:
1. Click the Save Steps As button to display the Save Selection As dialog box.
2. Enter a name, select the appropriate option for the saved selection, and click OK.
Example
Notice that a third step has been added to the product selection. A Match condition has been
added that keeps all products that contain the letters “batt” in the name.
When the query is executed, the product dimension portion of the query is evaluated as
follows:
1. All products in the Photo division are returned.
2. The 64MB Memory Card product is removed.
3. The Photo products that contain the string “batt” in the product name (that is, all
battery products) are kept.

Oracle Database 10g: Using OLAP 7-22


Applying User Attributes in Queries
Recall that two user attributes, Postcode and Gender, were created in the AW for the
Customer dimension. These attributes are associated with the lowest level in the dimension
hierarchy.
You can use these kind of dimension attributes to filter your OLAP queries.
To access User attributes in your query, perform the following steps:
1. Display the appropriate dimension in the Edit Worksheet Wizard.
2. Use the Match folder on the Condition tabbed page to display the attributes.
Example
In the example in the slide, a multistep selection for the Customer dimension uses both the
Postcode and Gender attributes to return all female customers in postal code 59200.

Oracle Database 10g: Using OLAP 7-23


Using the Selected Members Tabbed Page
In the Edit Worksheet Wizard, you can use the Members tabbed page of the Selected list to
preview the result of any dimension selection.
Example
In the example from the previous slide, the user really wants to see a list of Customer
members that are returned by the multistep selection (all female customers in postal code
59200), rather than a view of the measure data that is associated with those members.
In this case, the Members tabbed page in the Selected list is used as a preview of dimension
members returned by the selection.
You can also obtain a count of the member set that is returned a multistep selection by
clicking the scroll bar on the Members tabbed page. You see that there are 37 female
customers in postal code 59200.

Oracle Database 10g: Using OLAP 7-24


Viewing the Graph
Although you may choose to display only a crosstab when you create a worksheet, the graph
is also available; it is merely hidden. The reverse is also true. Therefore, you can view or
hide either the crosstab or graph in any worksheet.
To view the graph, select View > Graph.
Most worksheet items can be displayed or hidden by using the toggle features of this menu.
A check mark indicates that the item is currently displayed.

Oracle Database 10g: Using OLAP 7-25


Using the Graph
The graph is driven by the same query as the crosstab. Therefore, when you change data
selections for the crosstab, the graph automatically updates with the same data. By default,
the layouts of the presentations are also linked. Later in this lesson, you learn how to unlink
the presentation layouts.
Note: If you want to create a graph that uses a separate query, you can simply create a new
worksheet with a new graph.

Oracle Database 10g: Using OLAP 7-26


Modifying the Graph
There are many ways that you can modify the graph. You can change:
• Graph formatting characteristics, including:
- Grid lines
- Gradient effect
- 3D effect
- Plot area
• Graph layout
• Graph type
• Graph position
In the pop-up menu, you can also choose to hide the graph.

Oracle Database 10g: Using OLAP 7-27


Adding a Title
You can add a title to a worksheet by displaying the title area. You can also add individual
titles to both the crosstab and the graph.
To add a title to the worksheet, perform the following steps:
1. From the main menu, select View > Title to make the worksheet title area visible.
2. Double-click the title area to display the Edit Title dialog box.
3. Enter a descriptive title. You can also use the text-formatting tools to change the color,
style, position, and size of the title text.
4. Click OK.

Oracle Database 10g: Using OLAP 7-28


Inserting a Hyperlink
You can insert a hyperlink to a title or text area of the worksheet.
To add a hyperlink, click the Edit Hyperlink tool, and enter the appropriate text and
destination information.

Oracle Database 10g: Using OLAP 7-29


Saving the Worksheet and Workbook
When you first save a workbook, you can provide a name for both the worksheet and the
workbook.
Naming the Worksheet
To provide a name for the worksheet, perform the following steps:
1. From the main menu, select Edit > Rename Worksheet. Or, right-click the worksheet
tab, and select Rename Worksheet from the menu.
2. In the Rename Worksheet dialog box, enter a short descriptive name.
3. Click OK.
Saving the Workbook
To save the workbook, perform the following steps:
1. From the main menu, select File > Save.
2. In the Save As dialog box, enter a name.
3. Click OK.
Note: A saved workbook is stored as an XML object inside the Discoverer Catalog in the
database.

Oracle Database 10g: Using OLAP 7-30


Viewing the Finished Report
The saved worksheet can now be made available for viewing and analysis by other
Discoverer Plus OLAP and Discoverer Viewer users.
Notice that the graph type has been changed from Bar to Multi-Pie. Also, the report layout
has been changed by moving the Channel dimension to the Page Items area, and Sales Profit
has been added to the report.

Oracle Database 10g: Using OLAP 7-31


Adding a Worksheet to a Workbook
To add a new worksheet to a workbook, perform either of the following:
• Select File > New from the main menu.
• Click the New Worksheet button .
The Worksheet Wizard is displayed, enabling you to choose the same worksheet items that
are presented in the Workbook Wizard.

Oracle Database 10g: Using OLAP 7-32


Combining Measures of Different Dimensionality
Earlier in this course, combing measures of different dimensionality was examined. The
Oracle OLAP engine manages this combination automatically because all measures,
whatever their shape, share the dimensions.
In the example in the slide, the Profit and Budget Profit measures have different shapes:
• They are both dimensioned by the Product, Channel, and Time dimensions, but the
Profit measure is also dimensioned by Customer. The Budget measures are three
dimensional, and the Sales measures are four dimensional.
• The Budget measures are not dimensioned by Customer dimension—that is, the
Budgets do not vary by customer. Therefore, when viewed on their own, the Customer
dimension is not present. However, in the context of this report, the Profit measure
from the 4D Sales cube has been selected. Because Profit is dimensioned by Customer,
notice that Discoverer has included the Customer dimension in the worksheet display.
In this particular example, the only Customer value that is useful for the report is “Total of
All Customers.” Because the analysis being performed does not vary by Customer, the
Customer dimension may be removed from the worksheet display. In Practice 7-2, you learn
how to remove a dimension from the worksheet display.

Oracle Database 10g: Using OLAP 7-33


Combining Measures of Different Dimensionality (continued)
In the lesson titled “Creating Calculated Measures,” you created several Variance
calculations from templates. In each case, the measure elements of the equation have
different shapes. Again, Oracle OLAP handles the shape difference with ease. The formula
of the resulting calculation retains a superset of the dimensions of the measures.
Example
In the example, the Profit vs Budget calculation is added to the report. This calculation is
constructed of the following formula:

PROFIT_VARIANCE = PROFIT – BUD_PROFIT

Profit is four dimensional, and Budget Profit is three dimensional. So Profit vs Budget is
four dimensional. This is why you added the Variance calculations to the four-dimensional
Sales cube in the lesson titled “Creating Calculated Measures.”

Oracle Database 10g: Using OLAP 7-34


Stoplight Formats
Discoverer Plus OLAP supports a wide range of formatting options for reports, including
report headings, report titles, and report footers.
In addition, powerful cell-based formatting is also supported. These “data-driven
formatting” capabilities highlight information in the data body of the report, enabling users
to quickly identify data that meets important business criteria.
Stoplight formats are one of the most common implementations of data-driven formatting.
They enable report developers and end users to quickly identify overachieving and
underachieving performance by color-coding data that falls into desirable, acceptable, and
unacceptable ranges.
Accessing Format Options
All presentation and data-driven format options, including stoplight formats, can be found in
the Format menu.

Oracle Database 10g: Using OLAP 7-35


Creating Stoplight Formats
To create a stoplight format, click the New Stoplight Format button. In the New Stoplight
Format dialog box, perform the following steps:
1. Enter a name.
2. Select the measure or cells to which the format should apply.
3. Enter the upper and lower thresholds for desirable and unacceptable values.
4. Click OK.
Note: You can also set up stoplight formats by using the Stoplight toolbar. This toolbar can
be displayed by selecting View > Toolbars > Stoplight toolbars from the menu.

Oracle Database 10g: Using OLAP 7-36


Stoplight Format Reporting
The example in the slide shows the result of the stoplight format in the report.
As you change dimension values for Time and Channel, the stoplight format updates
automatically.

Oracle Database 10g: Using OLAP 7-37


Creating OLAP Calculations in Discoverer
The same OLAP Calculation Wizard that is found Analytic Workspace Manager and
OracleBI Spreadsheet Add-In is also used in Discoverer Plus OLAP. You create calculations
in each tool in exactly the same way.
Creating OLAP Calculations in OracleBI Discoverer
To launch the Calculation Wizard in Discoverer Plus OLAP, click the New Calculation tool
or select Tools > Calculations from the menu.
When you create a calculation in Discoverer Plus OLAP, the object is stored in the end
user’s personal Discoverer Catalog folder. The calculation can be kept as a personal object,
or can be shared with other Discoverer users.

Oracle Database 10g: Using OLAP 7-38


Summary
In this lesson, you learned how to create analytical reports that access the AW from
Discoverer Plus OLAP.

Oracle Database 10g: Using OLAP 7-39


Practice: Overview
In this practice, you create a new worksheet and workbook. By using wizards and interactive
techniques, you create a trend analysis report on sales margin performance that uses prebuilt
calculations and a stoplight format.

Oracle Database 10g: Using OLAP 7-40


Practice 7-2: Overview
In this practice, you add another worksheet to the workbook. You create a report that
compares Sales Revenue with Budget Revenue over four years, on a quarterly basis. This
report is designed to identify the revenue trends, and also to see how closely the projected
figures compare with actual data. The report can also be used to compare other actual and
budget measures, such as profit and cost.
Because all the budget measures are not dimensioned by Customer (and, therefore, are the
same as having been aggregated to Customer Total), Customer is removed from the query.

Oracle Database 10g: Using OLAP 7-52


Overview
So far in this course, in less than two days, you have learned:
• The concepts and rationale for choosing OLAP (online analytical processing), and
specifically Oracle OLAP, as part of your business intelligence (BI) infrastructure
• The elements of the logical dimensional data model, as used by Oracle OLAP
• How to design, map, and maintain high-performance and scalable analytic workspaces
(AWs) in Oracle Database 10g, using Analytic Workspace Manager (AWM) 10g
• The power of the multidimensional data model and best practices of features, such as
how to control multidimensional data sparsity within Oracle Database 10g
• Advanced performance and efficiency features of the Oracle Database 10g OLAP
option, including the use of compressed cubes and logical cube partitioning with
Oracle Database 10g
• How to build a wide range of business calculations that enrich the analytic content of
your AW, increasing its business value
• How to use OracleBI Spreadsheet Add-In to analyze your Oracle OLAP data
• The powerful OLAP capabilities of OracleBI Discoverer Plus OLAP (a component of
the Oracle Business Intelligence 10g suite and a popular tool) for the access, analysis,
querying, and reporting of information provided by the Oracle database with the OLAP
option.
This has all been achieved via easy-to-use GUI tools and wizards.

Oracle Database 10g: Using OLAP 8-2


Oracle OLAP Platform: Features for IT
You are now well aware that Oracle offers two administrative tools to facilitate the
development of analytic workspaces: AWM 10g and Oracle Warehouse Builder (OWB) 10g.
Both these tools use the AW API to define an AW and its contents and manage the life cycle
of an AW.
Analytic Workspace API
The AW API is a Java API that enables the information technology (IT) developer to focus
on the business model when building an OLAP-based application and working with high-
level objects such as dimensions, cubes, and measures. The physical implementation of these
objects is handled by the AW API. The AW API is used by both independent software
vendors and Java-savvy IT professionals to productively integrate OLAP functionality into
existing solutions or to develop new ones.
The AW API delivers most of the functionality required to deliver an OLAP solution. Not all
of this functionality is exposed in the current release of the administrative tools, and there
are certainly instances when it is useful to expose OLAP capabilities in different ways to
address the requirements of a given solution.
The AW API gives you this flexibility, and you see an example of this later in this lesson.

Oracle Database 10g: Using OLAP 8-4


AWM 10g Viewing Options
In earlier lessons, you learned how to use AWM 10g to design, map, build, and maintain
AWs in AWM’s Model view. All objects created in the Model view conform to the Standard
Form design specification.
Standard Form Characteristics
An AW that is built in Standard Form has the following characteristics:
• Enables immediate access by OLAP tools, such as OracleBI Beans, OracleBI
Spreadsheet Add-In, and Discoverer Plus OLAP
• Is required for all the preceding Oracle Business Intelligence tools and others from
Oracle and third-party software providers that use the Java OLAP API to query Oracle
Database 10g OLAP data
• Consists of a very specific style of physical implementation. AWM automatically
creates and maintains metadata and supporting dimensional objects in the AW’s
physical storage, some of which OLAP developers may exploit to access more of the
power of the multidimensional engine within Oracle Database 10g.

Oracle Database 10g: Using OLAP 8-6


Using the AWM 10g Object View
The Object view displays the physical objects in an AW by object type.
For example:
• The object definition (and perhaps data) for a measure is stored as an object type of
variable and/or formula.
• The rules for an aggregation plan are stored in an object called an aggregation map.
• A logical dimension created in the AWM Model view is physically implemented in a
number of objects. The dimension members are stored in an object type called a
dimension. There are other supporting structures (to contain level, hierarchy, and
attribute information, and so on) and metadata objects: some of which are dimensions,
some are relations, some are variables, and so on.
Note: You should never use the Object view to delete or modify the definitions or properties
of objects that are automatically created when using the Model view. Doing so could
invalidate the Standard Form implementation and could make the AW inaccessible by OLAP
API-based tools. AWM 10g (actually the underlying XML-based AW API) assumes sole
responsibility for maintaining this important metadata.

Oracle Database 10g: Using OLAP 8-8


Using the OLAP Worksheet Interface
OLAP Worksheet provides a command-line interface for advanced Oracle OLAP users and
developers. OLAP Worksheet is an interface that enables enhancement and customization of
the AW. You can use it to edit, test, and run OLAP DML programs and scripts.
Command-Line Interface
OLAP Worksheet provides a mechanism for running OLAP DML commands and programs.
It also provides an interface for running SQL statements. If you are familiar with Oracle
Express Server, you will recognize OLAP DML as an enhanced version of the proven
Express Stored Procedure Language (SPL). OLAP Worksheet is the OLAP DML equivalent
of SQL Worksheet that Oracle database users have known for many years.
Note: OLAP Worksheet, like the Object view, is a very powerful tool. It gives full access to
the physical objects in your AW. Therefore, you should be careful when using it. It is
important that you do not delete any objects in your Standard Form AWs that are created in
the Model view, or modify any metadata objects or properties. Doing so risks damaging the
ability of your OLAP API-based tools and applications to interact properly with your AW.

Oracle Database 10g: Using OLAP 8-10


Entering OLAP DML Commands
You use OLAP Worksheet to enter OLAP DML commands and run DML programs. Within
the Worksheet interface, you enter a command in the Query window and execute it. The
result of your command is displayed in the Response window. The Query Log shows you a
log of your most recent commands.
Options for Executing Commands
On the Options menu, if the “Execute on Enter” check box is selected, commands that you
enter in the Query window are executed when you press [Enter]. If the option is not selected,
then you must click the Execute button or press [F5] for your commands to be run.
You can enter more than one command by separating them with semicolons. They are
executed in order. If you use the Execute Commands button, you can enter a series of
commands on separate lines and have them all execute, in order, with a single click.
Helpful Hot Keys
• F1: Open the Help system
• F2: Open the command history (Worksheet/Command History)
• F4: Edit the selected code line
• F5: Execute commands in the Query window
• F10: Execute the collected code lines

Oracle Database 10g: Using OLAP 8-11


Using SQL in OLAP Worksheet
When working with DML, it is sometimes useful to be able to view the contents of a table or
a view via a SQL statement. OLAP Worksheet can be toggled into “SQL Mode” to enable
the user to enter SQL statements instead of OLAP DML commands without having to open a
new tool, and connect once more in that tool as a new session.
To execute SQL commands in OLAP Worksheet, perform these steps:
1. Select the SQL Mode option in the Options menu.
2. Execute the command by pressing either [F5] or [Enter].
Your choice depends on whether or not you have selected the “Execute on Enter”
option.
3. The results are displayed in a new window.

Oracle Database 10g: Using OLAP 8-12


Using the OLAP Worksheet Help System
OLAP Worksheet offers you an extensive Help system, including full online help for OLAP
DML. OLAP DML enables developers and power users to truly exploit the power of Oracle
OLAP. It is beyond the scope of this course to explain OLAP DML, but it is recommended
additional learning for anyone who wants to deliver more advanced OLAP systems.
Accessing OLAP DML Help
You can access OLAP DML Help in one of these two ways: Either use the F1 key or use the
Help menu item and select OLAP DML Language Help.
Viewing Help Contents
You can view the contents of a help topic by selecting a topic on the Contents tabbed page.
In the example in the slide, the user performs these steps:
1. Selects OLAP DML Language Help from the Help menu
2. Drills down into the contents under OLAP DML Basics and double-clicks the
“Expressions and Formulas” link for more information. The selected topic is displayed.
You can move through the Help topics by either clicking the Next button (>) to move to the
next page or clicking any of the links on the page.

Oracle Database 10g: Using OLAP 8-13


Using Oracle OLAP Help: Index Tab
You can also use the Index tabbed page to find help. With the Index tabbed page, you can
find help on the entire range of topics in an alphabetically sorted list. There is also a search
facility to help you find the topic that you want.
Example
Here, a user who knows that Oracle OLAP can easily calculate growth rates, depreciation,
rates of return, and so on, has used the search capability to learn more:
1. The user enters the search string Financial Functions, and then presses [Enter].
2. The middle window on the Index tabbed page displays all topics that might be helpful.
By clicking the topic required, the user can open the help page for that topic.
3. The help information about the topic appears (in this example, a table of Financial
Functions that are available in OLAP DML). Hypertext links are available throughout
the Help system to guide you through related topics and to provide you more details.

Oracle Database 10g: Using OLAP 8-14


Oracle OLAP Calculation Capabilities
Oracle OLAP provides a wide range of calculation types that can be organized into two
broad categories: calculations along dimensions and calculated measures.
Calculations Along Dimensions
Data can be calculated for one or more measures along the members of the dimensions.
Oracle OLAP also supports several such methods, including the following:
• Aggregation: Aggregating detail data to provide subtotals and totals. Aggregations can
be calculated using many different methods, including sum, average, and first.
Aggregation occurs according to the parent-child relationships that define the
hierarchies of a dimension. You learned about aggregation in the lesson titled
“Applying Advanced Dimensional Design and Cube Processing Techniques.”
• Allocation: Creating lower-level data from summary data. The allocation process uses
methods that are the inverse of the aggregate operations. Allocation is used in planning
applications that employ a top-down approach to setting budgets and targets.
Allocation is also based on the parent-child relationships that define the hierarchies of
a dimension, together with rules that control the basis for allocating data down to child-
level members of the dimension.

Oracle Database 10g: Using OLAP 8-15


Oracle OLAP Models
• An Oracle OLAP model enables you to define a set of interrelated equations that
can assign results either to a measure or to a dimension value, across the
members of a dimension, and independent of any hierarchy (no hierarchy is
necessary).
• Some members of the dimension have data populated for them from a data
source, or by an end-user application, whereas others are calculated by the
model—in advance as a maintenance task, at a specific moment in time usually
under control of an end-user application, or dynamically at query time.
• Each calculated member of the dimension can have its own calculation rules
(which can be extremely sophisticated).
• Models are very powerful, and often used in financial and other OLAP
applications with sophisticated interrelated calculation requirements.
In the following example, you examine a cube in an AW that is being used for
financial analysis. It includes a simple financial statement, implemented as a model
over a dimension called LINE. In the example, the LINE dimension is maintained
just like any other dimension, via AWM 10g. The developer has used information
provided in the source table for that LINE dimension to build and populate a model
in the AW.
Oracle Database 10g: Using OLAP 8-17
Models: An Example on a LINE Dimension
In this example, it is assumed that the information needed to populate a model in a Financial
Data Cube in an AW is maintained from outside of the AW by a feeder application.
1. In the example, a dimension called LINE is created, which will contain the line items
for a financial statement. To calculate many of the lines in that statement, use a model.
2. Map it to a source table called LINE_TBL. The contents of this dimension are
maintained just like those of any other dimension. Models can be created over any
dimension.
3. In the source table LINE_TBL, the model equation, for those dimension members that
are to be calculated, is being maintained via an attribute (see the MODEL_EQUATION
column).
4. An additional attribute called VarianceCalcType is maintained. This is used in an
example later in this lesson.
After the dimension is maintained, via the AWM 10g Maintenance Wizard, the members of
the dimension are available in the AW.

Oracle Database 10g: Using OLAP 8-18


Using Models
The MODEL equations are contained in a physical object called a model.
The basic steps for using a model are as follows:
1. Create the LINE dimension and define its model calculations in a model object,
programmatically via the AW API, using OLAP DML (or via a user interface in a
future release of the AWM tool).
2. Load or enter data into the required measures for those dimension members that are not
the results of a calculation.
3. Trigger the action to solve (or execute) the model for the selected measures. This can
be performed dynamically and automatically, or on demand by an application.
In the example in the slide, a model has been created for some of the members of the LINE
dimension, based on the contents of LINE_TBL, and OracleBI Spreadsheet Add-In is used
to analyze the data.
• A user selects the LINE dimension members required on a report and chooses to view
the Actuals and Plan measures for the year 2005.
• Data for the “input” dimension values is loaded or entered first from a source system or
by an end-user application.
• When the model is executed, the noninput dimension values are calculated for the
required measures, using the calculation rules in the model. This can include any
measure dimensioned by the modeled dimension (LINE in this example).
Oracle Database 10g: Using OLAP 8-20
Benefits of Models
Models have the following benefits:
• The model object is defined and stored in the AW so that all users of the AW
(regardless of the tool or API) see the same results.
• A model automatically determines the correct order in which to evaluate the equations,
even including the evaluation and solving of simultaneous equations (if required).
• The model can be applied to any measure that has the modeled dimension (in the
example, LINE) as one of its dimensions. In the example, on the previous page, the
model is solved for both the Actual and Plan measures. There could be other
measures such as Forecast, and there may be different versions of plans and forecasts
based on different planning assumptions or scenarios. All can be solved over the LINE
dimension by using the same model.
• Models can be executed (solved) in a variety of ways, including:
- Dynamically solved at query time. (This is similar to aggregations, which can be
set to aggregate data dynamically at query time.)
- In advance by running a script
- On command by an application

Oracle Database 10g: Using OLAP 8-21


Understanding More About Calculated Measures
In the lesson titled “Creating Calculated Measures,” you learned how to create calculated
measures in AWM 10g by using the Calculation Wizard. In this example, a new Calculated
Measure called “Financial Variance” is created in a “Financial Data” cube. Having created
Financial Variance using the Calculation Wizard, you can review its definition in the Model
view by highlighting it in the navigation pane. Notice that the “Expression” of the
calculation is displayed.
Expressions
When a calculated measure is created using the Calculation Wizard in AWM 10g, the
calculation rules are assigned to the expression of the measure. In the example, the
calculated measure named FINANCIAL_VARIANCE has an expression that is the
equivalent of Actuals - Plan. The expression in a calculated measure refers to the
Standard Form IDs of the objects that are referenced in the calculation.
Note: For some calculated measures, the expressions are not visible. This can occur when
the expression spans multiple lines. In these cases, the expressions can be reviewed in the
Object view or in OLAP Worksheet.

Oracle Database 10g: Using OLAP 8-22


Calculated Measures Using Custom Expressions
The OLAP Calculation Wizard can be used to create very powerful calculations, including
ratios, shares, and time series.
In addition, the OLAP option enables you to create custom calculations that use the features
of the dimensionally-aware OLAP DML (including use of conditional logic) and have access
to a large library of sophisticated analytic functions.
Because the Oracle OLAP calculation engine in the AW is so powerful and flexible, it is not
possible for the AWM 10g Calculation Wizard to facilitate the creation of every possible
kind of measure. However, it is possible to create more sophisticated calculated measures by
adding OLAP commands into a calculation expression to define the very specific
calculations for your business.
In the example in the slide, you see how OLAP DML conditional logic syntax (if, then, else)
is combined with Standard Form IDs for installation of the calculation via the AW API:
1. The calculation name to use as part of the equation can be found in the ID field of the
measure. The syntax for the name is [CubeName].[MeasureName].MEASURE.
2. The expression is used to calculate variance. Note that in this case the equation
examines the VARIANCETYPE attribute to determine the proper calculation.
3. The result is displayed in a query in OracleBI Spreadsheet Add-In.
Oracle Database 10g: Using OLAP 8-23
Using Custom Expressions to Alter Display Behavior
Sometimes, cube designers want to control the display behavior of measures in the AW. For
example, they want to display data only for particular levels of aggregation or particular
members of dimensions. Here is an example that might be a useful enhancement to the
measures that you created in earlier lessons.
Example
Consider the Sales_Variance calculation created in the lesson titled “Creating
Calculated Measures.” Because the Budget measures in the Budgets cube are 3D (not
dimensioned by Customer), whereas the Sales measures are 4D (dimensioned by Time,
Product, Channel, and Customer), calculations involving measures from both cubes
implicitly loop around Customer.
Logically, however, Budget Sales and, therefore, the Variance measures are for the Total for
All Customers. There is no Budget in fact for lower levels of detail on the Customer
dimension. By default, however, if the user chose to drill down into the Customer dimension,
while displaying Budgets or any of the calculations based on Budgets, then the same values
would be repeated for all Customers. This is potentially confusing for the end user who may
be unaware that Budgets do not vary by Customer.
In this scenario, you may decide to use DML in a calculated measure implemented via the
AW API to control the display behavior (without affecting the physical storage of the data).
Oracle Database 10g: Using OLAP 8-25
Using Custom Expressions to Alter Display Behavior (continued)
You can use the skills learned in the last example to handle this situation. By creating a
calculated measure with the additional dimension over the data that is physically 3D, it is a
simple job to control with precision how the base Budgets cube measures can be displayed in
an application involving more dimensions.
This is a powerful feature of Oracle OLAP. Notice how measures of many different physical
shapes can be combined, displayed, and manipulated without compromising the efficiency of
the most appropriate underlying storage.
Because the display measure needs to be 4D, create the calculation in the 4D Sales cube.
“Customer” is now in the dimensionality of its result. Next, use OLAP DML in the equation
to control what the calculation result is for any particular customer or set of customers.
As in the last example, a combination of OLAP DML conditional logic (if, then, else), along
with the Standard Form object IDs for the AW API, is used in the AW. This measure now
returns only a number (from the original measure in the Budgets cube) if you are at the Total
Customer level (where the Budgets make sense).
Note: SALES_AW in your SH_AW_TUTOR schema includes these calculated measures in
the “Fancy Calculations” Measure Folder.

Oracle Database 10g: Using OLAP 8-26


Using OLAP Calculations in Practice
In practice, you find that any OLAP solution provides many calculated measures, and the
number of calculated measures far exceeds the number of stored measures.
The reason is simple: Any analysis requires comparisons to some type of benchmark. This
benchmark may be previous year’s sales, market shares, or budget plans. The relative
importance of the different type of benchmarks can depend on who is doing the analysis. For
example, a sales manager may be very focused on how this quarter’s sales are comparing
with targets, whereas a product manager examines sales growth in comparison with that in a
previous period.
Interestingly, if you look across the types of calculations that users need, you will find
patterns. For example, nearly all business intelligence analyses have a time series
component. Users want to see a measure’s performance year to date, year over year, period
over period, and so on. It does not matter whether the data is financial, sales, or
manufacturing in nature.
As you have seen, Oracle OLAP calculates data very quickly, and AWM makes it very easy
to define these calculations individually, using the Calculation Builder. But it is clearly
useful for cube developers to have a fast and easy way of maintaining large numbers of
standard calculations into an AW, without having to define them one by one in the
Calculation Wizard.
Oracle Database 10g: Using OLAP 8-27
Using Excel to Define OLAP Calculations
You can use the Calculation Builder to define all of these typical business calculations.
However, the Calculation Builder is really optimized for defining a single calculation at a
time, which makes creating large numbers of measures a tedious and time-consuming task.
To make it easy to define many calculations, you can use Microsoft Excel with the OLAP
Spreadsheet Calculations sample that is downloadable from OTN. In this example, each row
of the spreadsheet represents an OLAP calculation. The calculations may be based on a
template (such as the Calculation Builder) or a free-form equation including the use of the
OLAP DML for conditional logic and access to the several hundred multidimensional-aware
analytic functions available within the AW.
The fields in each row of the spreadsheet represent inputs into that particular calculation. For
example, to define Budget Sales Prior Period, you supply the following:
• The calculation type (template or free-form equation)
• The measure name and description
• The cube where the calculation will be created
• The template to use (for example, Prior Period) or the calculation expression
• The measure folder where the calculation will be saved

Oracle Database 10g: Using OLAP 8-28


Spreadsheet Calculations Demonstration
Your class tutor will now show you the SpreadsheetCalcs tool in action. This is a “sample”
available for download from the OLAP pages on Oracle Technology Network (OTN).
From a start point of just five stored measures:
• Budgets cube: Budget Sales and Budget Profit
• Sales cube: Sales, Quantity, and Costs
The use of the SpreadsheetCalcs sample tool makes it a very quick job for the tutor to build
the rest of the calculations (visible) in SALES_AW. And there are many more that could be
derived from these five stored measures.
SALES_AW in SH_AW_TUTOR contains 126 measures in total, including 39 calculated
measures in the Budgets cube and 82 calculations in the Sales cube, and every measure is
organized into Measure folders also maintained from the spreadsheet.
Note: You find installed on your classroom computers, a copy of the spreadsheet that is used
to add a large number of calculated measures into SALES_AW in the SH_AW_TUTOR
schema. If you followed Practices 3, 4, and 5 carefully, and if your cubes and measures have
the correct names, then you can use the tool to add the remaining measures into your AW.

Oracle Database 10g: Using OLAP 8-29


Excel Leverages the AW API
The SpreadsheetCalcs Excel sample uses the AW API—the same API as used by OWB and
AWM—to maintain calculated measures in the Standard Form AW.
The spreadsheet input fields reflect the API requirements for a particular calculation
definition. These fields are read by an AW API-based Java program that defines the measures
in the AW based on the user input. These calculations are then shared by any user of the AW.
As you have seen, it is very simple to define hundreds of calculations in a matter of minutes.

Oracle Database 10g: Using OLAP 8-30


Input Fields
To help facilitate creation of calculations, many of the input fields in the Excel-based
SpreadsheetCalcs sample provide choice lists that are data driven.
For example, when defining a Prior Period calculation, you can use the choice list to select a
valid AW measure (stored or calculated) to be used as the basis for the Period Ago
expression.
This choice list is populated by querying the AW’s metadata through OLAP ActiveViews.
Any tool or application that can query the Oracle database via SQL can query these views to
learn about the dimensional data model of that AW. On the next page, you see some
examples.

Oracle Database 10g: Using OLAP 8-31


Metadata Retrieved via Views
Conveniently, Oracle OLAP metadata is available through both the AW API and SQL.
In the SpreadsheetCalcs sample, the metadata used to drive the input fields is queried using
Excel VBA (Visual Basic for Applications) through OLAP’s Active Views.
To retrieve the list of AWs, the following query is issued by the Excel macro:
SELECT owner || '.' || AW as AW
FROM all_olap2_aws
WHERE sf_version IS NOT NULL;
This query returns to Excel the list of AWs (for example, SH_AW.SALES_AW) that the
current user has access to. The list is used to help populate the choice list for the Target AW
field in the spreadsheet. Similar queries are issued to return the list of cubes and measures.
From an Oracle SQL*Plus command, a query to list the measures in the Budgets cube might
be as follows:
SELECT aw_name, aw_cube_name, aw_measure_name, display_name
FROM all_olap2_aw_cube_measures
WHERE aw_name='SALES_AW' AND
aw_cube_name = 'BUDGETS';

Oracle Database 10g: Using OLAP 8-32


User-Defined Functions
The earlier examples of custom calculated measures show how OLAP DML, via the AW
API, can be used inside a calculation expression to enhance the capability of the calculated
measure.
In most cases, this is sufficient, especially because this technique can take advantage of the
power from hundreds of OLAP DML functions for calculating data.
However, sometimes there is a calculation requirement that is specific to your organization,
or specific to a particular application, that cannot be easily calculated in a regular Oracle
OLAP expression. That is, there is not even a prebuilt OLAP DML function that does what
you need.
In this case, you can use OLAP DML to create a custom user-defined function.
A user-defined function is an OLAP DML program that is written so that it returns a data
value every time it is executed. The program can then be referred to by a calculated measure
and called for all the cells required by the query. Although this does require OLAP DML
programming skills, this is an extremely powerful feature of Oracle OLAP, which means that
even the most complex calculations can generally be delivered into a measure that can be
used like any other in any tool that can access the AW.

Oracle Database 10g: Using OLAP 8-33


Creating User-Defined Functions
Here an OLAP DML program profitmargincat_program is created. This program
(which is called as a custom function) may be defined and edited either with the OLAP
Worksheet command line or in the AWM 10g Object view.
1. In the program, the IF/THEN/ELSE logic simply evaluates the values in the
ProfitPct measure, which is created earlier in the Calculation Wizard as Profit
 Sales. Based on the specified thresholds, a text value of HIGH, MEDIUM, or LOW is
returned from this function.
Note: This example is designed to demonstrate the technique. A program object is not
actually required here. For this functionality, as you have already seen, a simple formula can
achieve the same result. However, this technique is extremely powerful. Examples of using
this approach may include:
• Functions that dynamically run forecasts or allocations, and then return the desired
result
• Functions that perform specific business calculations according to the specific
calculation rules adopted by your organization

Oracle Database 10g: Using OLAP 8-34


Creating User-Defined Functions (continued)
2. A calculated measure profit_margincat is created via the AW API, with the
appropriate Data Type (in this case, TEXT). The calculation expression for this
measure is the name of the custom function: profitmargincat_program.

Oracle Database 10g: Using OLAP 8-35


Creating User-Defined Functions (continued)
After the measure is created in the AWM via the AW API, it is immediately available for use
in your query tool of choice (in this case, OracleBI Discoverer Plus OLAP).
3. The new measure, calling your user-defined OLAP DML function, is included in a
report with other measures and calculations derived in the AW.

Oracle Database 10g: Using OLAP 8-36


SQL Access to Analytic Workspaces
Oracle OLAP, as discussed in an earlier lesson, not only provides a specialised OLAP API
for the use of dimensionally aware OLAP tools and applications (such as OracleBI
Spreadsheet Add-In, OracleBI Discoverer, OracleBI Beans, and tools and applications
developed with that technology), but also provides access via simple SQL. Regular ANSI
SQL, with no special syntax or knowledge, is required.
This feature of Oracle OLAP is unique, and is changing the way that people think about and
use OLAP. With traditional OLAP databases, data has to be copied out of the relational
database and duplicated into separate stand-alone databases. After it is duplicated there, data
is accessed via that particular server’s proprietary multidimensional API, and separate tools
that are designed specifically to work with that database, and which may not be used to
access data in other databases, such as the source relational database itself.
If the OLAP system is generating additional business value (perhaps simply through
increased calculation capabilities, or perhaps even generating new data such as for budgets,
plans, and forecasts), quite often that newly created calculated data has to be stored and
copied back to a relational database where regular SQL applications can access and use the
data. This can result in more duplication and more delays. With Oracle OLAP, measure
data—whether stored or being calculated on the fly—can be accessed by a simple SQL
query.
Oracle Database 10g: Using OLAP 8-37
Simple SQL Access to Analytic Workspaces
The slide illustrates two SQL queries.
The first example is very simple. It selects some data from a single relational table or view,
based on some filters on columns in that table or view.
• Because there is no need to get data from other tables, there are no joins.
• Because the user has asked to see only the sales and costs (data stored in two of the
columns in the table or view), there is no requirement for any calculations to be
defined in the SQL query. The query is just selecting the measures required from the
appropriate columns.
• There is also no SUM/GROUP BY aggregations in the SQL—in this query, it is not
required because all the rows that are required are also already contained in that table
or view.
The absence of joins, calculations, and aggregations in the SQL makes it a very simple SQL.

Oracle Database 10g: Using OLAP 8-39


Degrees of Interaction with the AW
The SQL interface to the AW in the Oracle database is very flexible, enabling varying levels
of interaction. In each case, the access is enabled by an Oracle database function called
OLAP_TABLE. The OLAP_TABLE function basically enables a SQL query to connect to a
specified AW, and then present the specified multidimensional objects from the AW into
virtual rows and columns. To the SQL tool, they look fully solved, prejoined, precalculated,
and preaggregated. In actuality, all the data and all the calculations are being managed inside
the AW.
The OLAP_TABLE function is very flexible.
By selecting from a view built over the AW, it makes the presence of the AW transparent to
the SQL application. The application needs to have no knowledge of the OLAP option. It
just needs to issue the SQL. This means that existing SQL tools and applications need no
modification to use Oracle OLAP. If they can generate a simple SQL query, they can use
Oracle OLAP. On the following page, you can see a simple example of a view that is using
the OLAP_TABLE function to present some data from an AW to the SQL tools.

Oracle Database 10g: Using OLAP 8-41


SQL Access to AWs: Key Points
The SQL Access feature takes full advantage of the natural ability of the AW to present
data—any data that it can store, calculate, or derive—as if it is already calculated, already
aggregated, and prejoined, even if the AW is actually doing some or all of that calculation on
the fly, in response to the query.
This promotes the use of very simple SQL to any data or calculation that the AW is capable
of retrieving or calculating. Indeed, the most effective use of this feature by generic SQL
tools and applications is by those that can indeed write the very simplest SQL and retrieve
the columns and rows (at the appropriate level of aggregation) from a single view that
logically contains “everything” in the AW.
Thus, an Oracle OLAP AW can be used not only by specialized OLAP-aware tools such as
OracleBI Discoverer OLAP and OracleBI Spreadsheet Add-In, but also by general purpose
SQL-based report writers, query tools, and SQL applications.
All of these benefit from the power and query performance of Oracle Database 10g with the
OLAP option.

Oracle Database 10g: Using OLAP 8-43


Summary
In this lesson, you learned about some of the advanced functionality that is available with
Oracle OLAP. In particular, you learned how models can be used to extend the calculation
capabilities of an AW and how OLAP DML can be used to extend calculated measures.

Oracle Database 10g: Using OLAP 8-44


Oracle Database 10g: Using OLAP 8-45

You might also like