March 25, 2008
Contributed by Mike Tarallo, Pentaho Team Member

Evaluating Pentaho Analysis Using Your Own Data

This document contains instructions and information that helps you evaluate Pentaho Analysis using your own data. This document should be used with the current version of the Pentaho Open BI Suite, version 1.6. It is assumed that you are familiar with the Pentaho Design Studio and the Pentaho BI Platform.

Pentaho Analysis is built on the popular Mondrian OLAP engine. The Pentaho BI Platform embeds the Mondrian engine as part of its architecture. Along with the Pentaho BI Platform, the Mondrian engine processes MDX requests with the ROLAP (Relational OLAP) schemas. These schema files are XML metadata models that are created in a specific structure used by the Mondrian engine. These XML models can be considered cube-like structures which utilize existing FACT and DIMENSION tables found in your RDBMS. It does not require that an actual physical cube is built or maintained; only that the metadata model is created. The structures and related API are outlined in the Mondrian Technical Guide that accompanies the Mondrian distribution as well as the Schema Workbench.

This XML-based metadata structure can be created using a text editor, Pentaho Cube Designer, or the Schema Workbench. I have found the Schema Workbench to be the best tool for this task; however, there are some additional steps necessary to create the Pentaho Analysis View. This process will be made easier in future releases.

Additional information is available at the following locations:

Pentaho Analysis Services Mondrian Project 

Pentaho Analysis Product Offering 

Mondrian Schema Workbench Software 
(software to build Pentaho Analysis Schemas)

Pentaho Cube Designer 

Pentaho Design Studio Software

This document adheres to the following assumptions:

Creating a Pentaho Analysis View Using the Schema Workbench

Follow the five basic steps below when creating a Pentaho Analysis View using the Schema Workbench to create the ROLAP model:

  1. Configure your RDBMS JNDI data source for your Java application server so that the Pentaho BI Platform accesses the desired data.
  2. Create your Pentaho Analysis Schema Model using Schema Workbench
  3. Publish your Pentaho Analysis Schema Model to the Pentaho BI Server
  4. Create the Pentaho Analysis View Action Sequence
  5. Execute the Pentaho Analysis view using a Web browser

Configuring your RDBMS JNDI data source on your application server

Use the resources listed below to find instructions for configuring your RDBMS JNDI data source:

Creating your Pentaho Analysis Schema Using the Schema Workbench

Follow the instructions below to create your schema:

  1. Download and unzip the Schema Workbench
  2. Create a "drivers" folder in the location where you extracted the files: C:\Pentaho\Install\workbench-\drivers
  3. Copy your JDBC driver to that folder. For example for Oracle 10g, the latest ojdbc14.jar file (found from Oracle's Web site) to that location were copied.
  4. Follow the schema_workbench.pdf documentation; it can be found in the "doc" sub-directory: C:\Pentaho\Install\workbench-\doc.
  5. The best way to learn how to create a simple schema using the Schema Workbench is to open an existing *.mondrian.xml file provided with the Pentaho Open BI Server, such as the one found in the ..\pentaho-solutions\samples\analysis directory in the solution repository.

    Note: The sample *.mondrian.xml files require you to place the Hypersonic or MySQL JDBC driver in the "drivers" directory and set up the appropriate connection URL and CLASS in Tools > Preferences section prior to opening them.

  6. Use the Mondrian Technical Guide documentation as a reference to understand what the Mondrian structures are. When developing using the GUI you can add additional elements that the Schema Workbench might not expose in the GUI.

Creating a Simple Schema

Make sure data types used in the schema are appropriate with what is in your RDBMS. Sometimes dates in RDBMS need to be defined as Strings in the schema design depending on how your RDBMS reads and uses the date data type. Notice in the example below that GAME_DAY is a DATE, GAME_MONTH is a VARCHAR, and GAME_SEASON (which is YEAR) is a number. Make sure your data types in the schema match accordingly.


Follow the instructions below to create a simple schema:

  1. Go to Tools > Preferences to enter your JDBC parameters for your RDBMS

  2. Make sure the database is running before you click Accept.
  3. If an error occurs, start the database, then close and restart the Schema Workbench.
  4. Go to File > New > Schema to name the schema in name attribute value.
  5. Right-click Schema > Add Cube to name the cube in name attribute value.
  6. Select Table:Table, select schema ID, if applicable, and the fact table name.
  7. Make sure that Table: displays Table:<your_fact_table_here>.
  8. Right-click the cube name and select Add Measure.
  9. Name the measure, select an aggregator such as sum; select the column and data type.

  10. Right-click the cube name and select Add Dimension.
  11. Select the appropriate foreign key and dimension type such as a Standard Dimension or Time Dimension.
  12. Expand the newly created dimension and select Hierarchy.
  13. Name the hierarchy, select primaryKeyTable and primaryKey.
  14. Select Table:Table, select the schema and the Table name
  15. Right-click Hierarchy and add level.
  16. At minimum, select the Name level, the table, and the column. Sometimes it is necessary to specify the levelType for certain date dimension data types to work correctly.
  17. Repeat step 15 and 16 for different dimensional levels.

Publishing Your Analysis Schema on the Pentaho BI Platform

Follow the instructions below to publish your analysis schema:

  1. Go to File > Save; save the file to the Pentaho Solution repository in this structure: ..\pentaho-solutions\samples\analysis or to a directory on your local workstation, which you can then transfer to the Pentaho Solution repository on the remote BI server.
  2. Save the file as <yourfilename>.mondrian.xml>; you must specify *.mondrian.xml).
  3. Test a simple MDX query by clicking, File > New > MDX Query. A success message appears.

  4. Enter query in query window on top.

    Note: If query fails to return data then there may be an issue. Adjust the schema design accordingly and retest. Most common problems are the data types being used. It is possible for the schema to still run successfully when deployed to the Pentaho Platform.

Creating the Pentaho Analysis View Action Sequence

Follow the instructions below to create the action sequence:

  1. In the Pentaho Design Studio, select your solution path, right-click the folder, and select BI Platform > New Action Sequence.

  2. Enter the name for action sequence and select Create Analysis View and click Finish.

  3. Select Analysis View under Process Actions.
  4. Modify the Data Model and Data Source parameters accordingly. The Data Model is the path location and XML file you saved in Step 1 under Publishing your Analysis Schema Model on the Pentaho Open BI Server. The Data Source is the JNDI name you used when creating your data source in section, Configuring your RDBMS JNDI data source on your application server.

  5. Save and test your Pentaho Analysis View using the URL with the appropriate solution= and path= directory names where you saved your .xaction and file.mondrian.xml files. You can use the TEST tab in Design Studio or copy and paste the URL into a browser.