Lesson 2: Querying OLAP Data Using Oracle BI Answers

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

NOTE: This tutorial requires either Oracle Database 11.2 or 12.1.

Approximately 30 minutes.


This tutorial covers the following topics:

Identify the OLAP Repository

Query OLAP Data

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.


In the previous lesson, Creating BI EE Metadata for OLAP Cubes, you used the Oracle BI Administration tool to create a repository that contains the appropriate metadata to describe OLAP sample data.

In this lesson, you will use the repository that you previously created to query the OLAP 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

Before starting this tutorial, you should:

Have successfully completed the Lesson 1: Creating BI EE Metadata for OLAP Cubes.



1. Install Oracle Database 11.2 or 12.1 with the OLAP Option.

Download and install both components of the sample schema following the instructions in Installing the Oracle OLAP 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


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


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 Repository

Before you can access the repository for your OLAP data, you must identify it as the default repository in the NQSConfig.ini file.

To modify the confiig file appropriately, perform the following steps:


Using an edit tool such as MS Notepad, open the NQSConfig.ini file. It is located in the following directory:


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.



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:

- 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)



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



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

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:

Back to Topic List

Open the Sales Cube Subject Area


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:


Result: The Oracle Business Intelligence login screen appears in your browser.



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

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.



In the Presentation Server window, click the Answers link.

Result: Oracle BI Answers appears in the browser.



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.

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:


Using the Answers selection pane, perform the following:


Drill on Channel, Geography, Product, and Time.

Result: the dimension columns that you defined for the Presentation layer appear.



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.



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:



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.


In the Results tab, drill on Europe. Sales data for the European countries are returned.



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



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



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

Result: the following filter critera now appears:



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



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



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.



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:


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.



In the Save Filter window:

- Click My Filters

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

- Click OK.

Result: the saved filter is added to the My Filters folder:



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

Then, click the Remove All (Columns) button:



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 Ytd Pr Yr Pct Chg
How is Sales Ytd

The resulting Criteria display looks like this:



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


Click the CY2009 item under My Filters.

Result: the Apply Saved Filter window appears.



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:



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


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



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.



Click the Results tab to view the data.


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"



Click the CY2009 link in the table to drill down. The results should now look like this:

Again, all measure data is computed perfectly.



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.



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 OLAP 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 Cubes.



After you finish experimenting with the data, simply close the browser to exit BI Answers.

Back to Topic

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 OLAP Cubes tutorial. For information about the OLAP data model, and how it was created, see the Oracle OLAP Tutorial Series on Oracle Learning Library.

Back to Topic List

Place the cursor over this icon to hide all screenshots.