using microsoft excel with oracle 11g

69
Using Microsoft Excel With Oracle 11g Cubes This tutorial contains the following sections: Purpose Time to Complete Overview Scenario Software Requirements Prerequisites Connecting to the Oracle OLAP Cube Creating the Sales Report Selecting Report Items Applying Formatting Performing and Sharing Ad Hoc Analysis Adding A Chart Summary Resources Purpose This tutorial covers how to use Excel 2007 with Oracle11g OLAP data for easy and powerful ad hoc query and analysis. Time to Complete Approximately 1 hour. Overview

Upload: mallikarjun-rao

Post on 25-Oct-2014

52 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Using Microsoft Excel With Oracle 11g

Using Microsoft Excel With Oracle 11g Cubes

This tutorial contains the following sections:

PurposeTime to CompleteOverviewScenarioSoftware RequirementsPrerequisitesConnecting to the Oracle OLAP CubeCreating the Sales Report

Selecting Report ItemsApplying Formatting

Performing and Sharing Ad Hoc AnalysisAdding A Chart SummaryResources

Purpose

This tutorial covers how to use Excel 2007 with Oracle11g OLAP data for easy and powerful ad hoc query and analysis.

Time to Complete

Approximately 1 hour.

Overview

The Simba Technologies MDX Provider for Oracle OLAP allows you to use the powerful and popular ad hoc query and analysis capabilities of Microsoft Excel PivotTables® and PivotCharts® with your Oracle OLAP business intelligence data. PivotTables provide cross-tab functionality to comprehensively present your data in order to answer complex analytical questions. PivotCharts provide visual insight and reporting in a powerful, dashboard-like manner.

Simba’s MDX Provider for Oracle OLAP is a client-side driver that leverages Excel’s strengths for ad hoc query and analysis, as well as new Excel 2007 functionality based upon the latest advances in the multi-dimensional (MDX) data standard.

Page 2: Using Microsoft Excel With Oracle 11g

Simba’s MDX Provider natively connects Microsoft Excel with Oracle 11g OLAP Option. It works seamlessly to parse and process multi-dimensional queries from Excel and integrate with Oracle OLAP via SQL/ODBC.

Scenario

Using the Oracle11g OLAP sample schema, you will create an Excel 2007 report to analyze year-end Sales for calendar year 2009, with the objective of finding product dimension members that are underperforming, as compared to the prior year.

To achieve this objective, you will:

View stored, calculated, and custom OLAP measures broken out by the appropriate dimension members

Use hierarchical navigation to drill through the data

Apply basic report formatting options to enhance the clarity of the report

Apply visualization tools to the data using conditional formatting to reveal important information that otherwise may not be readily obvious

Page 3: Using Microsoft Excel With Oracle 11g

You will further analyze the data using interactive ad hoc query techniques to discover trends in the data from a regional perspective.

Finally, you will add a Chart to the report.

Software Requirements

The following is a list of software requirements:

Page 4: Using Microsoft Excel With Oracle 11g

Microsoft Excel 2007 (Excel 2007 with SP2 is preferred. Excel 2003 is also supported.)

The MDX Provider for Oracle OLAP (The MDX Provider for Oracle OLAP is sold directly by Simba Technologies. It supports Microsoft Excel 2007 and 2003, and Oracle Database 11g OLAP Option Release 1 and 2.)

o Product information and evaluation copies are avialable at Simba's web site: click here.

o For pricing and purchasing information from Simba's web site, click here.

Prerequisites

Before starting this tutorial, you should:

1.Install or have access to Oracle Database 11g Enterprise Edition with the OLAP Option (Patch level 11.1.0.7 or higher). 

2.Download and install the OLAPTRAIN schema following the instructions in Installing the Oracle OLAP 11g Sample Schema.

Notes: The Sample Schema installation package includes two parts:

1. Installing the base OLAPTRAIN schema

2. Installing the SALESTRACK analytic workspace in the OLAPTRAIN schema

Complete both parts of the package.

 

3 .Install and configure the MDX Provider for Oracle OLAP.

Instructions are found in the MDX Provider for Oracle OLAP - User and Administrator Guide . The guide may be downloaded from http://www.simba.com/MDX-for-Oracle-OLAP-documentation.htm. This document is also provided by Simba technologies as part of the MDX Provider for Oracle OLAP package.

Follow the instructions for :

Installation

Client-Side and Excel Configuration

 

4 .Have access to Microsoft Excel 2007.

Page 5: Using Microsoft Excel With Oracle 11g

Connecting to the Oracle OLAP Cube

In the Prerequistes section, you were instructed to install and configure the MDX Provider for Oracle OLAP.

As part of the configuration process, you must create a Microsoft Data Source Name (DSN) to the Oracle database and the OLAPTRAIN sample schema.

After creating the DSN to the Oracle database, use the Excel Data Connection Wizard to complete the connection process.

Notes:

See the Client-Side and Excel Configuration topic in the MDX Provider for Oracle OLAP - User and Administrator Guide for detailed instructions on creating an Office Data Connection (.odc) to Oracle Database.

As you follow the directions in the Administrator Guide, you use the Data Connection Wizard to select an "Advanced" data source, and then the MDX Provider for Oracle OLAP as your OLE DB Provider option.

Page 6: Using Microsoft Excel With Oracle 11g

Finally, you specify the connection information that leverages your Oracle DNS entry and the OLAPTRAIN schema user information (the OLAPTRAIN user is the owner of the sample schema), as shown here:

Click Test Connection to ensure that you have entered the correct connection information.

Then, click Next to change the "Friendly Name" of the connection. (The "Friendly Name" is what you will see in the list of existing connections when you use the connection for additional spreadsheets.)

Finally, the wizard displays the OLAP Cubes for which the user has database permissions, as shown below. Select SALES_CUBE.

Page 7: Using Microsoft Excel With Oracle 11g

Accessing the SALES Cube

Once you click Finish in the Data Connection Wizard, you are presented with the Import Data dialog, shown in Step 4 below. Go to step 4 to continue.

Note: If you are creating a new workbook using an existing connection for the OLAP Sales Cube, start with Step 1 below.

1.If you have not already done so, create a new , blank workbook as shown here:

Page 8: Using Microsoft Excel With Oracle 11g

 

2.Select Data > Existing Connections.

Page 9: Using Microsoft Excel With Oracle 11g

Result: the Existing Connections dialog appears.

3.In the Existing Connections dialog, select the connection for the Sales Cube, and click Open.

Page 10: Using Microsoft Excel With Oracle 11g

Note: These are the "Friendly Names" and description fields for the connection, as mentioned earlier.

 

Page 11: Using Microsoft Excel With Oracle 11g

4.In the Import Data dialog, select the Pivot Table Report and Existing worksheet options. Then click OK.

Result: The MDX provider makes the database connection, finds the cube, places a pivot table placeholder in the worksheet, and populates the Pivot Table Field List pane with Measures and Dimension Hierarcies from the cube.

Page 12: Using Microsoft Excel With Oracle 11g

 

Creating the Sales Report

As stated in the Scenario section, you will create a report to analyze year-end Sales for calendar year 2009, with the objective of finding product dimension members that are underperforming, as compared to the prior year.

Later, you will further analyze the data to discover trends in the data from a regional perspective, and then finally you will add a Chart to the report.

Use the following steps to create the report, apply some basic formatting, and then add conditional formatting.

Selecting Report Items

Page 13: Using Microsoft Excel With Oracle 11g

Applying Formatting

Selecting Report Items

1.In the Pivot Table Field List, select the following four measures, in the following order:

Sales

Sales Ytd (Year to date)

Sales Pr Year (Year for the prior year)

Sales Pr Year Pct Ch (Percent change between sales and sales for the prior year).

Result: The data items automatically appear in the Values box and also in the pivot table.

Page 14: Using Microsoft Excel With Oracle 11g

Result: As shown below, only the data for Sales appears, since no Time dimension members have been selected yet. This value, in

Page 15: Using Microsoft Excel With Oracle 11g

fact, is the total sales for all dimension members in the cube.

 

2.Scroll down in the Pivot Table Field List to view the Dimensions. Drag and drop the Calendar Hierarchy (from the Time dimension) to the Row Labels box, like this:

Page 16: Using Microsoft Excel With Oracle 11g

Result: The top level dimension members of the Calendar_year hierarchy appear in the Row axis of the Pivot Table.

Page 17: Using Microsoft Excel With Oracle 11g

Notes:

o Since CY2007 is the oldest year for which data is stored, there are no "prior year' values.

o The CY2010 time period is currently used for forecasting purposes, and therefore only the 'prior year' values are available in this calendar year

3.Drag and drop the Standard Hierarchy (from the Product dimension) to the Row Labels box, below Calendar:

Page 18: Using Microsoft Excel With Oracle 11g

 

4.Drag the other two dimension hierarchies -- Sales Channel and Regional -- to the Report Filter box, like this:

Page 19: Using Microsoft Excel With Oracle 11g

This action enables you to filter the data by selecting members from either of those two dimension hierarchies on the "page" axis of the report, as shown here:

Page 20: Using Microsoft Excel With Oracle 11g

 

Applying Formatting

Page 21: Using Microsoft Excel With Oracle 11g

In this subtopic, you apply some basic report formatting to enhance the report clairity, and then you will add condition formatting to assist in revealing important analytic information in the data.

Before you begin formatting the report, close the PivotTable Field List.

Then, follow these steps:

1.First, turn off gridlines by deselecting the Page Layout > Gridlines > View.

 

2.Next, remove the display of Grandtotals.

A. Click the Options tab, and then select the Pivot Table > Options list, like this:

B. In the list, select the Options choice:

Page 22: Using Microsoft Excel With Oracle 11g

Result: The PivotTable Options dialog appears.

C. In the PivotTable Options dialog, click the Totals & Fiters tab, and then turn off the following options (as shown below):

o Show grand totals for rows

o Show grand totals for columns

o Mark totals with *

Page 23: Using Microsoft Excel With Oracle 11g

D. Click OK to apply the formatting changes.

3 .

Next, change the layout of the report to display rows in compact form. Click the Design tab, and then select the Report Layout > Show in Compact Form, like this:

Page 24: Using Microsoft Excel With Oracle 11g

Result: The report layout now looks like this:

Page 25: Using Microsoft Excel With Oracle 11g

4 .

Finally, turn off the display of pop-up tool-tips within the pivot table.

A. Right-click within the pivot table select PivotTable Options from the pop-up menu:

Page 26: Using Microsoft Excel With Oracle 11g

B. In the Display tab of the PivotTable Options dialog, deselect the Show contextual tooltips option (as shown below), and then click OK.

Page 27: Using Microsoft Excel With Oracle 11g

Next, you add several conditional formatting elements to highlight valuable trends and characteristics of the data.

 

5 .

First, add data bars to each of the measures in order to highlight the relative size of each data cell

A. Select any cell within Sales column of the pivot table. Then select Home > Conditional Formatting > Data Bars > Blue bars, as shown here:

Page 28: Using Microsoft Excel With Oracle 11g

Result: The selected Sales cell is formatted, like this:

Page 29: Using Microsoft Excel With Oracle 11g

B. To apply this format to all Sales cells, click the Formattting Options tool (next to the formatted cell) and select All cells showning 'Sales' values, as shown here:

Result: All Sales cells are formatted with blue bars.

Page 30: Using Microsoft Excel With Oracle 11g

 

6 .

Use the same technique to apply blue bars to the Sales Ytd and Sales Pr Year measures.

After formatting the two additional measures, the report should look like this:

Page 31: Using Microsoft Excel With Oracle 11g

 

7 .

Apply two conditional formats to the Sales Prior Year Percent Change measure.

A. Select any data cell within the Sales Pr Year Pct Chg measure. Then, select Home > Conditional Formatting > Icon Sets > More Rules, as shown here:

Page 32: Using Microsoft Excel With Oracle 11g
Page 33: Using Microsoft Excel With Oracle 11g

B. In the New Formatting Rule dialog, perform the following:

o In the Apply Rule to section, select All cells showing "Sales Pr Year Pct Chg" values.

o In the Format Cells Based on their Values section, select:

3 Arrows (Colored) as the Icon Style

The Number option as the Type for both the green and yellow arrows

The number 10 as the Value for the green arrow

Page 34: Using Microsoft Excel With Oracle 11g
Page 35: Using Microsoft Excel With Oracle 11g

C. Click OK.

Result: The conditional format provides a useful visual indicator of how sales is performing, as percent change comparison to the prior year.

D. Again, select a data cell within the Sales Pr Year Pct Chg measure and then select Home > Conditional Formatting > Icon Sets > More Rules.

Page 36: Using Microsoft Excel With Oracle 11g

E. In the New Formatting Rule dialog, specify the following:

In the Apply Rule to section, select All cells showing "Sales Pr Year Pct Chg" values.

In the Select a Rule Type section, select Format only cells that contain

In the Edit Rule Description section, specify: Cell Value > less than > 0 should be filled with a light red color.

F. Click OK to apply the second format to the Percent Change measure.

Page 37: Using Microsoft Excel With Oracle 11g

    

Performing and Sharing Ad Hoc Analysis

In this topic, you focus on the calendar year 2009 in order to perform analysis on product performance. You also learn how easy it is to share OLAP reports - including live access to the data.

Initially, high level data shows that sales trends look good for CY 2009. Now, start navigating the data.

1.Drill on CY2009 (click the "+" icon next to CY2009).

Result: Data for the four quarters of CY2009 appears. Trend indicators are showing some mixed results.

 

2.We want to investigate year-end results for 2009, so keep only the Q4 value. Right-click Q4-CY2009, select Filter > Keep Only Selected Item.

Page 38: Using Microsoft Excel With Oracle 11g

Result: all other time members are removed from the report, as shown here:

3 .

Remove Calendar year 2009 from the report.

A. Right-click CY2009 and select Show/Hide Fields from the pop-up menu.

B Then, click the Calendar_year option to de-select that field value.

Result: The year level is removed from the report, as shown here:

Page 39: Using Microsoft Excel With Oracle 11g

4 .

Next, change the color of the bars to distinguish between Time and Product values. Make Time values Green, and leave Product values Blue.

A. Click in the Q4-2009 Sales cell.

B. Select Conditional Formatting > Data Bars > Green bars.

C. Then, apply the format to All cells showing 'Sales' values for 'Calendar_quarter', as shown here:

Result: The report reflects the new format:

D. Repeat the same techniques to apply Green bars to the Sales Ytd and Sales Pr Year measures.

Result: The report now looks like this:

Page 40: Using Microsoft Excel With Oracle 11g

5 .

Next, you add a custom OLAP calculation that provides intelligent insight into product performance. This measure, named Product Alert, identifies any product member where there are performance concerns deaper within the product dimension hierarchy.

Product Alert is an OLAP function that returns one of two text values:

"ALERT", for any product member where there is negative sales growth at next lower level in the hierarchy -- when compared to the same period in the prior year.

"OKAY", for product members where all decendants at the next level down have positive sales growth.

Note: To learn more about creating OLAP calculations, see the Resources topic.

From the Field List menu, select Product Alert and drag to the Values box, just above Sales, as shown here:

Page 41: Using Microsoft Excel With Oracle 11g

Result: The new measure is added to the report.

Page 42: Using Microsoft Excel With Oracle 11g

6 .

Next, add a conditional format that visually highlights any ALERT value.

A. Select any data cell within the Product Alert measure.

B. Select Conditional Formatting > Icon Sets > More Rules.

C. In the New formatting Rule dialog, select the following options (as shown in the image):

o All cells showing 'Product Alert' values

o Format only cells that contain

o Cell Values > equal to > ALERT

Page 43: Using Microsoft Excel With Oracle 11g

D. Then, click the Format button.

E. In the Format Cells dialog:

o Click the Font tab and select the Bold option

o Click the Fill tab and choose the color Red

o Click OK.

Page 44: Using Microsoft Excel With Oracle 11g

The New Formatting Rule dialog now looks like this:

F. Click OK to apply the format.

Result: The report now looks like this:

Page 45: Using Microsoft Excel With Oracle 11g

The Product Alert measure indicates that there are product concerns somewhere within the Computers department -- even though the sales data shows overall good growth in the department for the fourth quarter of 2009 (over 9% growth).

The ALERT value leads us to examine the Computers department.

 

7 .

A. Drill on Computers.

Result: We see that two computer catagories have troubles: All Computer Furniture and total Server Computers.

Page 46: Using Microsoft Excel With Oracle 11g

Notes:

As indicated by the ALERT on the Computers department, we knew that there was at least one product category (the next level in the hierarchy) with negative sales growth. As we can see, sales for the All Computer Furniture category have dropped almost 29% in Q4-2009 as compared to Q4-2008.

In addition, an ALERT is raised on Total Server Computers. Even though the sales growth numbers are positive for this category (a 3.48% increase), the alert tells us that there is a negative sales growth problem at the next deaper level in the hierarchy (Product Type) for Total Server Computers.

8 .

Now, let's examine another product category: Total Personal Computers.

Initial observations include the following:

The blue data bars show that Personal Computers is the largest category in terms of sales contribution to the Computers department.

Sales growth for Total Personal Computers in Q4-FY2009 looks good (over a 10% increase).

There is no ALERT for product types within this category (that is, at the next lower level in the hierarchy).

A. To provide more analytic focus, remove the Sales Ytd measure: Right-click on the Sales Ytd measure heading, and select Remove Sales Ytd, as shown here:

Page 47: Using Microsoft Excel With Oracle 11g

B. Then, drill on Total Personal Computers.

Page 48: Using Microsoft Excel With Oracle 11g

Observations include the following:

We see that several product types within the Total Personal Computers category have ALERT conditions.

Although none of these product members show negative sales growth, we know that product members at the next deaper level in the hierarchy are underperforming.

From the blue data bars, we can quickly identify that the three largest contributing Personal Computer product types -- Computer

Page 49: Using Microsoft Excel With Oracle 11g

Storage, Personal Computers, and PC Sound -- all contain negative sales growth problems at the next hierarchy level.

C. Drill on Personal Computers.

Observations:

The largest contributing Personal Computer subtype (MacBook) had an 8% drop in Q4-2009 sales as compared to Q4-2008.

This, and other important product sales information is worth sharing with the Director of Sales for the Computers division.

Sharing OLAP Reports

Sharing an Excel report against OLAP data is extremely simple and powerful. You can:

A) Save the worksheet as a file and attach it to an email.

If the recipient has the MDX provider and access to the cube, they can then open up the report and go live against the cube.

Page 50: Using Microsoft Excel With Oracle 11g

If the recipient does not have access to the cube, they can view the static report in Excel.

B) Copy the contents of the report and paste it in another MS office application, such as Powerpoint or Word.

The Excel worksheet has a live connection to the OLAP data, and the Powerpoint or Word document has a live connection to the worksheet.

If the Excel report is changed in any way, the Powperpoint or Word document automatically updates.

9 .

Focus the product analysis solely on the Personal Computers category, and for different geographical regions.

A. Right-click Total Personal Computers and select Filter > Keep Only Selected Items, like this:

B. Then, drill on Total Personal Computers and right-click on any Product member in the Row Labels column. From the resulting pop-menu, select Show/Hide Fields > Department.

Page 51: Using Microsoft Excel With Oracle 11g

Result: This action hides (turns off the display) of the Department level in the hierarchy. The report now displays only category level members, for which Personal Computers is the only selected member.

Page 52: Using Microsoft Excel With Oracle 11g

Finally, use the Regional report filter to select Geography dimension members.

C. Select United States from the report filter by drilling through the Regional Geography hierarchy and clicking OK, like this:

Page 53: Using Microsoft Excel With Oracle 11g

Result: The report updates for the filtered selection.

Page 54: Using Microsoft Excel With Oracle 11g

D. Select other countries or geographic areas by using the Regional report filter. The report updates all stored and calculated data.

Adding A Chart

In this topic, you will re-orient the report to provide a regional perspective on sales of the Total Personal Computer market for the year 2009. Then, you will add a chart to the report to illustrate the monthly trends for this product category.

Follow these steps:

1.A. Collapse the drill on Total Personal Computers, and then click the Row Labels Filter tool, like this:

Page 55: Using Microsoft Excel With Oracle 11g

B. Choose Calendar_year from the Select field box, like this:

C. Drll on CY2009, select each of the Quarter members (as shown below), and then click OK.

Page 56: Using Microsoft Excel With Oracle 11g

D. In the pivot table, drill on all four quarters so that all of the 2009 month members are displayed.

F. Then, right-click Jan-2009 and select Show/Hide Fields > Calendar_quarter.

Result: This action removes both the Quarter and Year level members. The Row Labels axis now looks like this:

Page 57: Using Microsoft Excel With Oracle 11g

 

2.Use the PivotTable List to re-orient the report. Perform the following:

Deselect all measures from the Values list except for Sales.

Move the Standard (Product) hierarchy to the Report Filter area.

Move the Regional (Geography) hierarchy to the Column Lables area.

The Field area pane looks like this:

Page 58: Using Microsoft Excel With Oracle 11g

Result: the report looks like this:

Page 59: Using Microsoft Excel With Oracle 11g

3 .

Filter the report as follows:

A. Using the Standard (Product) report filter, select Total Personal Computers and then click OK.

Page 60: Using Microsoft Excel With Oracle 11g

B. Using the the Column Labels report filter, de-select Oceania and then click OK.

Page 61: Using Microsoft Excel With Oracle 11g

Result: The report should look like this:

Page 62: Using Microsoft Excel With Oracle 11g

4 .

Resize the data columns so that they are the same width.

A. Select columns B through F, right-click the selection, and choose Column Width from the pop-up menu, like this

Page 63: Using Microsoft Excel With Oracle 11g

B. Enter 15 as the column width value and click OK.

Result: The data bars indicate that Asia has contributed the largest amount of sales in the Personal Computer category across the selected regions regions over the calendar year of 2009.

Page 64: Using Microsoft Excel With Oracle 11g

 

5 .

Finally, add a Chart to enhance the new report.

A. Again, select columns B through F.

B. Select Insert > Column > Stacked Column 3D from the pop-up menu, like this:

Page 65: Using Microsoft Excel With Oracle 11g

Result: A chart is added to the report.

C. Dismiss the PivotChart Filter Pane.

Page 66: Using Microsoft Excel With Oracle 11g

D. Move the chart below the pivot table, and resize the chart, like this:

Page 67: Using Microsoft Excel With Oracle 11g
Page 68: Using Microsoft Excel With Oracle 11g

Observations: The chart adds value to the worksheet, clearly indicating:

The relative contribution of each region to Total Personal Computer sales

2009 monthly trends for each region in the Total Personal Computer product category

Summary

You can use MS Excel 2007 (and 2003) with Oracle11g to easily create BI reports from OLAP cubes and perform powerful ad-hoc analysis against live data. The live connection to OLAP cubes is created by Simba’s MDX Provider, which natively connects Microsoft Excel with the Oracle 11g OLAP Option.

In this tutorial, you have learned how to:

Connect Excel 2007 to an Oracle 11g Cube

Create a report of OLAP data, including a Pivot Table and a Chart

Format OLAP data, including using Conditional Formats

Perform ad-hoc analysis using native Excel 2007 features

Share worksheets of OLAP analysis

Resources

The following resources provide additional information for topics covered in this tutorial:

The MDX Provider for Oracle OLAP - User and Administrator Guide. See the Software Requirements topic.

Oracle OLAP home page on OTN

OU Instructor-led class - Oracle Database 11g: OLAP Essentials

To learn more about Oracle11g OLAP, refer to additional Oracle By Example (OBE) tutorials in the Learning Library.