52
Chapter 6 SAS ® OLAP Cube Studio

Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

Embed Size (px)

Citation preview

Page 1: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

Chapter 6

SAS® OLAP Cube Studio

Page 2: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

Section 6.1

SAS OLAP Cube Studio Architecture

Page 3: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

3

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.

Page 4: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

4

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.

Page 5: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

5

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.

Page 6: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

6

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.

Page 7: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

7

What Is SAS OLAP Cube Studio?The SAS OLAP Cube Studio is a Java interface for defining and building OLAP cubes in SAS®9.

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.

Page 8: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

8

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.

Page 9: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

9

Interaction with SAS Application ServersSAS OLAP Cube Studio uses different types of application servers:

SAS Metadata SAS Metadata ServerServer

Required for purposes of creating and Required for purposes of creating and managing metadata for both the cube managing metadata for both the cube and the processes for building the and the processes for building the cube.cube.

SAS Workspace SAS Workspace ServerServer

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

...

Page 10: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

10

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.

Page 11: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

11

SalesPerson Month Units SalesAmountJodi LeeJodi LeeJodi LeeJodi LeeJodi LeeJodi LeeTodd MunchTodd MunchTodd MunchTodd MunchTodd MunchTodd Munch

112233112233

647586735795

300200350250400300350150250350450250

NWAY Aggregation Concept (Optional)SalesData table:

Page 12: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

12

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;

Page 13: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

13

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;

Page 14: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

14

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

JLeeTMunchJLeeJLeeJLeeTMunchTMunchTMunch

011122333333

12 4 4 4 6 6 2 2 2 2 2 2

722024283636101214101214

1 2 3 4 5 6 7 8 9101112

.123..123123

360010001200140018001800 500 600 700 500 600 700

NWAY Aggregation Concept (Optional)SalesSummary table:

Page 15: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

15

NWAY Aggregation Concept (Optional)The _TYPE_ variable values display different types of summarizations.

1 0 12 72 3600

Review _TYPE_=0 (observation 1) in the SalesSummary table.

This observation displays summarizations for no particular SalesPerson OR Month; therefore, this summarization is overall summarizations for the entire data set.

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

Page 16: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

16

Review _TYPE_=1 (observations 2 - 4).

These observations display summarizations for each distinct Month across all SalesPerson values.

2 1 1 4 20 1000 3 2 1 4 24 1200 4 3 1 4 28 1400

NWAY Aggregation Concept (Optional)

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

Page 17: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

17

Review _TYPE_=2 (observations 5 - 6).

These observations display summarizations for each distinct SalesPerson across all Month values.

5 JLee 2 6 36 1800 6 TMunch 2 6 36 1800

NWAY Aggregation Concept (Optional)

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

Page 18: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

18

Review _TYPE_=3 (observations 7 - 12).

These observations display summarizations for each distinct SalesPerson broken down by Month values.

7 JLee 1 3 2 10 500 8 JLee 2 3 2 12 600 9 JLee 3 3 2 14 70010 TMunch 1 3 2 10 50011 TMunch 2 3 2 12 60012 TMunch 3 3 2 14 700

NWAY Aggregation Concept (Optional)

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

Page 19: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

19

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.

Page 20: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

22

5 JLee 2 6 36 1800 6 TMunch 2 6 36 1800

7 JLee 1 3 2 10 500 8 JLee 2 3 2 12 600 9 JLee 3 3 2 14 70010 TMunch 1 3 2 10 50011 TMunch 2 3 2 12 60012 TMunch 3 3 2 14 700

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

...

Page 21: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

23

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.

Page 22: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

27

2 1 1 4 20 1000 3 2 1 4 24 1200 4 3 1 4 28 1400

7 JLee 1 3 2 10 500 8 JLee 2 3 2 12 600 9 JLee 3 3 2 14 700 10 TMunch 1 3 2 10 500 11 TMunch 2 3 2 12 600 12 TMunch 3 3 2 14 700

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

...

Page 23: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

28

proc summary data=SalesData NWAY; class SalesPerson Month; var Units SalesAmount; output out=SalesSummary sum=TotalUnits TotalSales;run;

NWAY Aggregation Concept (Optional)If the NWAY option is used in the PROC SUMMARY statement ...

continued...

Page 24: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

29

NWAY Aggregation Concept (Optional)... the generated output table contains only the values where _TYPE_=3.

1 JLee 1 3 2 10 500 2 JLee 2 3 2 12 600 3 JLee 3 3 2 14 700 4 TMunch 1 3 2 10 500 5 TMunch 2 3 2 12 600 6 TMunch 3 3 2 14 700

Sales Total TotalObs Person Month _TYPE_ _FREQ_ Units Sales

Page 25: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

30

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.

Page 26: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

Section 6.2

The SAS OLAP Cube Studio Interface

Page 27: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

32

SAS OLAP Cube Studio: The InterfaceWhen 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.

Page 28: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

33

Tools, Menus, and Online HelpThe 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

Page 29: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

34

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

Shortcut Bar

...

Page 30: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

35

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

OptionsOptions Used to change the selected SAS Used to change the selected SAS Application Server and to test the Application Server and to test the connection to a logical SAS connection to a logical SAS Workspace Server.Workspace Server.

Create OLAP Create OLAP SchemaSchema

Used for creating new OLAP Used for creating new OLAP schemas.schemas.

Source Source DesignerDesigner

Used to design new source tables in a Used to design new source tables in a metadata repository.metadata repository.

Cube DesignerCube Designer Used to define and build a new cube.Used to define and build a new cube.

...

Page 31: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

36

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

Navigation Tree

Navigation Tree

Page 32: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

37

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

Status BarStatus Bar

Page 33: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

38

Messages WindowThe 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.

Page 34: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

39

Messages Window

Messages Window

Messages Window

Page 35: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

40

Using the Cube Designer WizardThe 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.

Page 36: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

41

Using the Cube Designer WizardThe General window is used to specify the cube’s name and description. You also select a storage location for the cube’s definition and a storage location for the physical cube.

Page 37: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

42

Using the Cube Designer WizardOn 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.

Page 38: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

43

Using the Cube Designer WizardThe 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.

Page 39: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

44

Using the Cube Designer WizardFrom this wizard window you launch the Dimension Designer wizard to define the cube’s dimensions and their associated hierarchies and levels.

...

Page 40: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

45

Dimensions, Hierarchies, and Levels

DimensionDimension a group of closely related hierarchies. a group of closely related hierarchies.

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

LevelLevel an element of a dimension hierarchy. an element of a dimension hierarchy. Levels describe the dimension from the Levels describe the dimension from the highest (most summarized) level to the highest (most summarized) level to the lowest (most detailed) level.lowest (most detailed) level.

...

Page 41: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

46

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

Page 42: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

47

Using the Cube Designer WizardIn 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.

Page 43: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

48

Using the Cube Designer WizardThe Finish window is where you review the details of the cube that you just defined and choose whether to only save the cube’s definition to the active metadata repository, or to save the cube's definition and buildthe cube.

...

Page 44: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

49

SAS OLAP Cube Studio Case Study TasksGoal: Build a cube in order to examine trends in length of

delivery over time and for different types of orders.

OrderFact OrionStar

Time DimensionOrder_YearOrder_Qtr Order_Month

Product DimensionOrder_TypeProduct_IDMeasures

Delivery_Time: Average Minimum Maximum

Quantity: Average

Total_Retail_Price: Sum

...

Page 45: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

50

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

Building a Cube

Register Source Tables

DefineData Libraries

CreateETL Jobs

DefineTarget Tables

CreateOLAP Cubes

View and AnalyzeData

CreateStored Processes

Create Reports

CreateInformation Maps

Use the InformationDelivery Portal

Metadata

Page 46: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

51

This exercise reinforces the concepts discussed previously.

Exercises

Register Source Tables

DefineData Libraries

CreateETL Jobs

DefineTarget Tables

CreateOLAP Cubes

View and AnalyzeData

CreateStored Processes

Create Reports

CreateInformation Maps

Use the InformationDelivery Portal

Metadata

Page 47: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

Section 6.3

SAS OLAP Cube Studio and Microsoft Excel

Page 48: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

53

Viewing Cube DataIn SAS®9 there are several options for viewing cube data including: SAS Enterprise Guide 3 the SAS Information Delivery Portal’s 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.

Page 49: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

54

Setting Cube PermissionsWhile 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.

Page 50: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

55

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

Setting Cube Permissions

Page 51: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

56

This demonstration illustrates the necessary steps so users can view the cube data via Microsoft Excel.

Importing the Cube into Microsoft Excel

Page 52: Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture

57

This exercise reinforces the concepts discussed previously.

Exercises