Sei sulla pagina 1di 52

Chapter 6

SAS OLAP Cube Studio

Section 6.1
SAS OLAP Cube Studio
Architecture

What Is OLAP?
OLAP (Online Analytical Processing) is a software
technology that enables users to dynamically analyze
data that is stored in multidimensional database tables.
Because of the way the data and its relationships are
stored, they are readily available for detailed queries and
analysis.

What Is OLAP?
Central to the OLAP storage process are cubes.
A cube is a set of data that is organized and structured
in a hierarchical, multidimensional arrangement, often
with numerous dimensions and levels of data.

What Is OLAP?
The classification information in the data is organized
into dimensions.
For example, a TIME dimension might have all input
columns related to time (date, month, year) grouped as
levels.
Dimension levels can then be organized into a hierarchy.
The hierarchy determines the logical order of the levels in
a dimension. The logical order makes it possible for users
to drill down into the cube data.

What Is OLAP?
Cubes also contain measures, which are based on
numeric analysis columns in the input tables.
These numeric values are summarized and stored in
the cube for quick access and analysis during a query.
Examples of measures include sales figures and
operational costs.

What Is SAS OLAP Cube Studio?


The SAS OLAP Cube Studio is a Java interface for
defining and building OLAP cubes in SAS9.
The Cube Designer wizard, which guides the user through
the process of creating and registering a cube,
is the main feature of SAS OLAP Cube Studio and is
also available in SAS ETL Studio.

What Is SAS OLAP Cube Studio?


Other tasks that can be performed using the SAS OLAP
Cube Studio include
defining OLAP schemas in a SAS Metadata
Repository
registering library definitions for the tables used to
build cubes
registering the tables used to build cubes
editing cube structure
deleting cubes
adding and deleting aggregations
viewing cube properties.

Interaction with SAS Application Servers


SAS OLAP Cube Studio uses different types of
application servers:
SAS Metadata
Server

Required for purposes of creating and


managing metadata for both the cube
and the processes for building the
cube.

SAS Workspace Used to generate and submit SAS


Server
code, and to access information
about SAS resources (that is, source
tables) for the cube.

...

NWAY Aggregation Concept (Optional)


OLAP cubes usually contain an NWAY aggregation. The
NWAY aggregation can be thought of as a table that
contains the crossing of all dimension levels of the OLAP
cube.
Example: Examine the concept of the NWAY
aggregation by discussing a summary table
created from the SUMMARY procedure.

10

NWAY Aggregation Concept (Optional)


SalesData table:
SalesPerson
Jodi Lee
Jodi Lee
Jodi Lee
Jodi Lee
Jodi Lee
Jodi Lee
Todd Munch
Todd Munch
Todd Munch
Todd Munch
Todd Munch
Todd Munch
11

Month
1
1
2
2
3
3
1
1
2
2
3
3

Units
6
4
7
5
8
6
7
3
5
7
9
5

SalesAmount
300
200
350
250
400
300
350
150
250
350
450
250

NWAY Aggregation Concept (Optional)


The SalesData table can be summarized using the
SUMMARY procedure, and the summary information
output to a new table called SalesSummary.
proc summary data=SalesData;
class SalesPerson Month;
var Units SalesAmount;
output out=SalesSummary sum=TotalUnits
TotalSales;
run;

12

NWAY Aggregation Concept (Optional)


A simple listing of the new summary table,
SalesSummary, can be created with a PROC PRINT
step.
proc print data=SalesSummary;
run;

13

NWAY Aggregation Concept (Optional)


SalesSummary table:
Sales
Obs Person Month _TYPE_ _FREQ_
1
.
0
12
2
1
1
4
3
2
1
4
4
3
1
4
5 JLee
.
2
6
6 TMunch
.
2
6
7 JLee
1
3
2
8 JLee
2
3
2
9 JLee
3
3
2
10 TMunch
1
3
2
11 TMunch
2
3
2
12 TMunch
3
3
2

14

Total
Units
72
20
24
28
36
36
10
12
14
10
12
14

Total
Sales
3600
1000
1200
1400
1800
1800
500
600
700
500
600
700

NWAY Aggregation Concept (Optional)


The _TYPE_ variable values display different types of
summarizations.
Review _TYPE_=0 (observation 1) in the
SalesSummary table.
Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
1

15

12

72

Total
Sales
3600

This observation displays summarizations for no particular


SalesPerson OR Month; therefore, this
summarization is overall summarizations for the entire
data set.

NWAY Aggregation Concept (Optional)


Review _TYPE_=1 (observations 2 - 4).
Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
2
3
4

1
2
3

1
1
1

4
4
4

20
24
28

Total
Sales
1000
1200
1400

These observations display summarizations for each


distinct Month across all SalesPerson values.

16

NWAY Aggregation Concept (Optional)


Review _TYPE_=2 (observations 5 - 6).
Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
5
6

JLee
TMunch

2
2

6
6

36
36

Total
Sales
1800
1800

These observations display summarizations for each


distinct SalesPerson across all Month values.

17

NWAY Aggregation Concept (Optional)


Review _TYPE_=3 (observations 7 - 12).
Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
7
8
9
10
11
12

JLee
JLee
JLee
TMunch
TMunch
TMunch

1
2
3
1
2
3

3
3
3
3
3
3

2
2
2
2
2
2

10
12
14
10
12
14

Total
Sales
500
600
700
500
600
700

These observations display summarizations for each


distinct SalesPerson broken down by Month values.
18

NWAY Aggregation Concept (Optional)


For the _TYPE_=3 observations, notice that observations
7 through 9 can be summarized to obtain the values for
observation 5.
Similarly, observations 10 through 12 can be summarized
to obtain the values for observation 6.

19

Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
7
8
9
10
11
12

JLee
JLee
JLee
TMunch
TMunch
TMunch

1
2
3
1
2
3

3
3
3
3
3
3

2
2
2
2
2
2

10
12
14
10
12
14

Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
5
6
22

JLee
TMunch

2
2

6
6

36
36

Total
Sales
500
600
700
500
600
700

Total
Sales
1800
1800
...

NWAY Aggregation Concept (Optional)


In addition to the previous example, notice that the
_TYPE_=3 observations 7 and 10 can be summarized to
obtain the values for observation 2.
Similarly, observations 8 and 11 can be summarized to
obtain the values for observation 3, and observations 9
and 12 can be summarized to obtain the values for
observation 4.

23

Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
7
8
9
10
11
12

JLee
JLee
JLee
TMunch
TMunch
TMunch

1
2
3
1
2
3

3
3
3
3
3
3

2
2
2
2
2
2

10
12
14
10
12
14

Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
2
1
1
4
20
3
2
1
4
24
4
3
1
4
28
27

Total
Sales
500
600
700
500
600
700

Total
Sales
1000
1200
1400
...

NWAY Aggregation Concept (Optional)


If the NWAY option is used in the PROC SUMMARY
statement ...
proc summary data=SalesData NWAY;
class SalesPerson Month;
var Units SalesAmount;
output out=SalesSummary sum=TotalUnits
TotalSales;
run;

continued...
28

NWAY Aggregation Concept (Optional)


... the generated output table contains only the values
where _TYPE_=3.
Sales
Total
Obs Person Month _TYPE_ _FREQ_ Units
1
2
3
4
5
6

29

JLee
JLee
JLee
TMunch
TMunch
TMunch

1
2
3
1
2
3

3
3
3
3
3
3

2
2
2
2
2
2

10
12
14
10
12
14

Total
Sales
500
600
700
500
600
700

NWAY Aggregation Concept (Optional)


The NWAY aggregation in an OLAP cube is similar to the
output table that is generated from a PROC SUMMARY
step using the NWAY option.
All other aggregations in an OLAP cube can be generated
from the NWAY aggregation.

30

Section 6.2
The SAS OLAP Cube Studio
Interface

SAS OLAP Cube Studio: The Interface


When connected to a SAS Metadata Server, the main
window of the SAS OLAP Cube Studio displays cube
information specific to that metadata server.
All cube administration tasks, such as creating and
updating cubes, are initiated from this window.
The main window has six main visual components:
the menu bar
the toolbar
the shortcut bar
the navigation tree
the status bar
the messages window.
32

Tools, Menus, and Online Help


The toolbar and pull-down menus provide fast access to
a set of selected commands. The icons available on the
toolbar depend on which window is active from within the
interface.

Menus and
Tools

33

The Shortcut Bar


The Shortcut bar is populated with icons for each task an
OLAP user would typically perform:

Shortcut Bar

34

...

The Shortcut Bar


The Shortcut bar is populated with icons for each task an
OLAP user would typically perform:

35

Options

Used to change the selected SAS


Application Server and to test the
connection to a logical SAS
Workspace Server.

Create OLAP
Schema

Used for creating new OLAP


schemas.

Source
Designer

Used to design new source tables in a


metadata repository.

Cube Designer

Used to define and build a new cube.


...

Navigation Tree
The navigation tree displays an organized list of the
cubes, OLAP schemas, and tables registered in the
selected SAS Metadata Repository.

Navigation
Tree

36

Status Bar
The status bar is located at the bottom of the SAS OLAP
Cube Studio application window. It displays short status
messages for the application.

Status Bar

37

Messages Window
The Messages window displays application messages
such as:
Application Server Error: Attempted
connection to Application Server failed.
Verify that the server is running.
To resize the Messages window, use your mouse to drag
the top edge of the window up or down. When you close
the window, your resized setting is saved.
To toggle the display of the Messages window, select
View Message Window.
38

Messages Window

Messages
Window

39

Using the Cube Designer Wizard


The Cube Designer wizard is used to
create and edit cube definitions that are stored in the
active metadata repository
build cubes based on the stored definitions.

40

Using the Cube Designer Wizard


The General window is used to specify the cubes name
and description. You also select a storage location for the
cubes definition and a storage location for the physical
cube.

41

Using the Cube Designer Wizard


On the Input window, you specify the data source that
provides the input data for your cube by selected an
already registered data source or by defining a new
data source.

42

Using the Cube Designer Wizard


The Drill-Through window is used to specify an optional
drill-through table. Drill-through tables can be used by
client applications to provide a view from processed data
into the underlying data source.

43

Using the Cube Designer Wizard


From this wizard window you launch the Dimension
Designer wizard to define the cubes dimensions and
their associated hierarchies and levels.

44

...

Dimensions, Hierarchies, and Levels


Dimension a group of closely related hierarchies.

45

Hierarchy

an arrangement of members of a
dimension into levels that are based on
parent-child relationships. Each hierarchy
provides a navigational path that enables
users to drill down to increasing levels of
detail.

Level

an element of a dimension hierarchy.


Levels describe the dimension from the
highest (most summarized) level to the
lowest (most detailed) level.
...

Using the Cube Designer Wizard


The Member Property window is where you can add,
modify, and delete member properties for the levels
in the cube.

46

Using the Cube Designer Wizard


In the Generated Aggregations window, you define
aggregations to be generated for the cube in addition
to whether the NWAY aggregation (the crossing of all
dimension levels) is automatically generated.

47

Using the Cube Designer Wizard


The Finish window is where you review the details of
the cube that you just defined and choose whether to
only save the cubes definition to the active metadata
repository, or to save the cube's definition and build
the cube.

48

...

SAS OLAP Cube Studio Case Study Tasks


Goal: Build a cube in order to examine trends in length of
delivery over time and for different types of orders.
Time Dimension
Order_Year
Order_Qtr
Order_Month
OrderFact

Measures
Delivery_Time:

49

Average
Minimum
Maximum

OrionStar

Quantity:

Product Dimension
Order_Type
Product_ID

Average

Total_Retail_Price:
Sum

...

Building a Cube
This demonstration illustrates building a cube using
SAS OLAP Cube Studio.

50

Define
Data Libraries

Create
Stored Processes

Register
Source Tables

View and Analyze


Data

Define
Target Tables

Create
Information Maps

Metadata

Create
ETL Jobs

Create Reports

Create
OLAP Cubes

Use the Information


Delivery Portal

Exercises
This exercise reinforces the concepts discussed
previously.

51

Define
Data Libraries

Create
Stored Processes

Register
Source Tables

View and Analyze


Data

Define
Target Tables

Create
Information Maps

Metadata

Create
ETL Jobs

Create Reports

Create
OLAP Cubes

Use the Information


Delivery Portal

Section 6.3
SAS OLAP Cube Studio and
Microsoft Excel

Viewing Cube Data


In SAS9 there are several options for viewing cube data
including:
SAS Enterprise Guide 3
the SAS Information Delivery Portals Visual Data
Explorer portlet
the SAS Web OLAP Viewer for Java
Microsoft Excel Pivot Tables.
This section shows how to use Microsoft Excel to view
a SAS OLAP cube.

53

Setting Cube Permissions


While the metadata about the cube is available to
all users by default, the data in the cube itself is not.
Permissions must be added manually for the desired
group of users to be able to display the cube data.
These permissions are granted using SAS Management
Console.

54

Setting Cube Permissions


This demonstration illustrates setting the appropriate
permissions on a cube using the SAS Management
Console so that users can view the cube data.

55

Importing the Cube into


Microsoft Excel

This demonstration illustrates the necessary steps so


users can view the cube data via Microsoft Excel.

56

Exercises
This exercise reinforces the concepts discussed
previously.

57

Potrebbero piacerti anche