Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

4/14/13

Querying OLAP Data Using Oracle BI Answers

Lesson 2: Querying OLAP 11g Data Using Oracle BI Answers


Purpose
This tutorial covers querying Oracle Database 11g OLAP Option data and calculations using Oracle BI Answers.

Time to Complete
Approximately 30 minutes.

Topics
This tutorial covers the following topics:
Overview
Prerequisites
Identify the OLAP 11g Repository
Query OLAP Data
More information

Viewing Screenshots
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all
screenshots simultaneously, so response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the
screenshot associated with that step. You can hide an individual screenshot by clicking it.

Overview
In the previous lesson, Creating BI EE Metadata for OLAP 11g Cubes, you used the Oracle BI Administration tool to create a
repository that contains the appropriate metadata to describe OLAP 11g sample data.
In this lesson, you will use the repository that you previously created to query the OLAP 11g data. Using BI Answers, you
learn how to select, display, and navigate through your OLAP data.
Note: If you did not complete the previous lesson, you can download a completed repository. See the Prerequisites section.
Back to Topic List

Prerequisites
Before starting this tutorial, you should:
Have successfully completed the Lesson 1: Creating BI EE Metadata for OLAP 11g Cubes.
Or...
1.

Install Oracle Database 11g with the OLAP Option (Patch level 11.1.0.7 or higher).

2.

Download and install both components of the sample 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

3.

Have access to or have Installed Oracle Business Intelligence Suite Enterprise Edition 10g Release 3 (version
10.1.3.4).

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

1/15

4/14/13

4.

Querying OLAP Data Using Oracle BI Answers

Download and unzip a complete, predefined repository for this lesson: Sales_Cube_OBE.zip.
Note: In the File Download window, select the <drive>:\<OracleBI_Installation_Location>\server\repository folder
as the destination. Then click Save.
Back to Topic List

Identify the OLAP 11g Repository


Before you can access the repository for your OLAP 11g data, you must identify it as the default repository in the
NQSConfig.ini file.
To modify the confiig file appropriately, perform the following steps:
1.

Using an edit tool such as MS Notepad, open the NQSConfig.ini file. It is located in the following directory:
<drive>:\<OracleBI_Installation_Location>\server\Config\
Then, scroll down to the [ REPOSITORY ] of the config file.
The sample repository (samplesales.rpd), which is shipped with the BI Enterprise Edition, is listed as the default
repository.

2.

Modify the config file as follows:


a.

Make a copy of the repository statement.

b.

Comment out the samplesales.rpd repository statement by adding a # (pound) symbol at beginning of the
line.
Modify the copied repository statement to specify either:

c.

- Sales_Cube.rpd as the default repository (if you completed the previous lesson)

- Sales_Cube_OBE.rpd as the default repository (if you downloaded the predefined repository)

3.

Save the NQSConfig.ini file, and close the Editor.

4.

Stop, and then restart, the Oracle BI Server service.

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

2/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

This step causes the BI Server to automatically read the new repository.
Back to Topic List

Query OLAP Data


To access the Sales Cube repository as a Subject Area in BI Answers and create an analytic report, perform the following
steps:
Open the Sales Cube Subject Area
Query OLAP Data
Back to Topic List
Open the Sales Cube Subject Area
1.

Using the Start menu, select Programs > Oracle Business Intelligence > Presentation Services.
Note: If BI EE Server is not on the local comupter, you can access the login screen by using the following URL in
your browser:
http://<hostname>:9704/analytics/saw.dll?Answers
Result: The Oracle Business Intelligence login screen appears in your browser.

2.

In the log In screen, enter olaptrain as the User ID, and oracle as the Password, as shown below:

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

3/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

Then, click Log In.


Notes: If you logged in using the Oracle BI Presentation Services method, go to step 3. If you logged in using the
BI Answers URL method, go to step 4.

3.

In the Presentation Server window, click the Answers link.

Result: Oracle BI Answers appears in the browser.


4.

In the Subject Areas box, click the SALESTRACK Sales Cube link, shown here:

Result: The Sales Cube presentation catalog is loaded, and the subject area appears in the Answers selection
pane.

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

4/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

Back to Topic
Query OLAP Data
Using BI Answers, you query the OLAP data in the same way you would any data source. BI Answers generates SQL queries
directly against the OLAP cubes by way of the cube views, as described in the previous lesson.
To use BI Answers:
Simply open the desired folder in the selection pane, and click on the item that you want to view. Each item is displayed
as a column in the Criteria tab.
Additionally, filters may be applied to any selected column, and various formatting criteria may be applied.
Finally, click the results tab to execute the query and display the data.
Follow these steps to create and modify queries against the sample OLAP data:
1. Using the Answers selection pane, perform the following:
a. Drill on Channel, Geography, Product, and Time.
Result: the dimension columns that you defined for the Presentation layer appear.

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

5/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

b. Drill on Sales Cube.


Result: the stored and calculated measures appear in the folders that you defined for the Presentation layer.

When you select the measures and dimension levels that you want:
The query is written against the OLAP cube views
The OLAP engine retrieves stored data and solves all of the selected calculations at the requested level of detail.

c. Under the Geography node, click Region.


Result: Geography {Region} is added to the Criteria tab.
d. Under the Sales Cube node, select the Sales measure.
The resulting display should look like this:
st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

6/15

4/14/13

The resulting display should look like this:

Querying OLAP Data Using Oracle BI Answers

2. Click the Results tab (or the Display Results button). Sales for the Geographical regions appears in the display.

Note: the Sales values are automatically returned for the "All" level in the other three dimension, as follows: Channel = "All
Channels"; Product = "All Products"; Time = "All Years". The correct level of aggregation for these dimensions is returned
because of the level-aware OLAP cube metadata that is part of the repository.
3. In the Results tab, drill on Europe. Sales data for the European countries are returned.

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

7/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

4. In the Answers selection pane, drill on Time and select Calendar Year. The Results display should now look something
like this:

5. Click the Criteria tab, then click the Filter tool for Time.

6. Select the year 2009 by entering CY2009 in the Value box. Then click OK.

Result: the following filter critera now appears:


st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

8/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

7. Under the Columns section of the Criteria tab, drag the Time tile before Sales, like this:

8. Click the Results tab. The report should look like this:

9. In the row for France, drill on CY2009. The following results appear:

The query automatcially returns data for the lowest level in the drill path.

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

9/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

10. Once again, click the Criteria tab.


As shown, BI Answers records changes to the query in the Filter section. You can modify, save, or remove any filter.

Save the filter on Calendar Year, as follows:


a.

In the Filters section:


- First delete the Region and Country filters by clicking the Delete icon [X] next to each. The resulting display looks
like this:

- Then, click the Save Filter button.


b.

In the Save Filter window:


- Click My Filters
- Enter CY2009 as the name, and Calendar Year 2009 as the description.

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

10/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

- Click OK.
Result: the saved filter is added to the My Filters folder:

11. In order to start a new query, click the Remove Filters button:

Then, click the Remove All (Columns) button:

12. From the BI Answers navigation pane, click on the following items (in the order specified):
All Regions (from Geography)
Calendar Year (from Time)
Department (from Product)
Then, from the Sales Cube measure folder:
Sales
Sales Ytd Pr Yr Pct Chg
How is Sales Ytd
The resulting Criteria display looks like this:

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

11/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

13. Apply the same filter to the Time dimension that you created previously, by using the saved filter:
a.

Click the CY2009 item under My Filters.


Result: the Apply Saved Filter window appears.

b.

In the Apply Saved Fitler window, select the Apply contents of filter ... option, and click OK.

Result: The filter is added to the query criteria:

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

12/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

14. Modify the Sales Ytd Prior Year % Change measure to show two decimal places.
a.

Click the Column Properties tool under Sales Ytd Pr Yr Pct Chg, as shown below.

b.

In the the Data Format tab of the Column Properties window:


- Select the Override Default Data Format option.
- Select 2 as value for the Decimal Places option.

- Click OK.
15. Click the Results tab to view the data.

Notes:
The How is Sales Ytd measure is a custom OLAP calculation that returns a text value based on
performance of the Sales Ytd Prior Year % Change measure. If the percent change in YTD Sales is above
15%, "Outstanding" is returned. If the percent change is between 0 - 15%, "On track" is returned. If the
percent change is negative, "Needs Improvement" is returned.
The stored and calculated OLAP data is returned, with each measure result correctly computed for the
selected dimension levels. In this case: Geography = "All Regions"; Time = "Calendar Year" (where year =
CY2009); Product = "Department"; Channel = "All Channels"
16. Click the CY2009 link in the table to drill down. The results should now look like this:

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

13/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

Again, all measure data is computed perfectly.

17. Next, click the Q1-CY2009 link in the table to drill down. The table should now look like this:

Notice that the How is Sales measure shows the Cameras and Camcorders product department is under-performing in
both January and February. The the Sales Ytd Prior Year % Change measure provides the data points.
18. Click the Cameras and Camcorders link in Feb-2009 to drill down. The table should now look like this:

Notice that the Cameras and Accessories product category is the problem area in the selected time period.
As you can see, the power and performance of the Oracle OLAP11g Option is easily accessible to Oracle BI Answers, and
all other Oracle BI EE tools. In addition, creating the appropriate metadata is quick and easy, as described in Creating BI
EE Metadata for OLAP 11g Cubes.
19. After you finish experimenting with the data, simply close the browser to exit BI Answers.
Back to Topic

More Information
To see a demonstration of BI Answers against this OLAP data model, click Fast Answers to Tough Questions
Using Simple SQL.
The OLAP data used in this tutorial was created using steps found in the Building OLAP11g Cubes tutorial. For

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

14/15

4/14/13

Querying OLAP Data Using Oracle BI Answers

The OLAP data used in this tutorial was created using steps found in the Building OLAP11g Cubes tutorial. For
information about the OLAP 11g data model, and how it was created, click the link.
To learn more about Oracle Business Intelligence Enterprise Edition, refer to additional OBEs on the OTN Web
site. From this page, select Business Intelligence Start > Oracle BI Enterprise Edition
Back to Topic List
Place the cursor over this icon to hide all screenshots.

st-curriculum.oracle.com/obe/db/11g/r1/olap/biee/querydata.htm

15/15

You might also like