22
Pentaho Mondrian OLAP CUBES

Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Embed Size (px)

Citation preview

Page 1: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Pentaho Mondrian

OLAP CUBES

Page 2: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Installation

• Install Tomcat (version 5.0.25 or later).– Set JAVA_HOME Environment Variable pointed to

SDK installation.

Page 3: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Installation

– Add %JAVA_HOME%\bin to general path• Test TOMCAT installation:– localhost:8080

Page 4: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Installation

• Explode mondrian.rar to TOMCAT_HOME/webapps– Test: localhost:8080/mondrian/

Page 5: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Creating OLAP Cube

• Explode psw-ce-3.6.1.rar– Put mysql-connector-java-5.1.29-bin in drivers

folder.– Execute workbench.bat– Options Connection• Use the sakila user to connect to the database sakila

– Open File: TOMCAT_HOME\webapps\mondrian\WEB-INF\queries\Sakila.xml

– See the CUBE Rentals

Page 6: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Mondrian Cube Structure

Fact Table

Dimension

Measure

Levels

Dimension Table

Page 7: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Creating a Query to Rentals OLAP Cube

• File New MDX query:– select {[Measures].[Rental Counts]} on columns,

{[Customers].[All Customers]} ON rows from Rental

– Execute in JPIVOT• http://localhost:8080/mondrian/testpage.jsp?query=re

ntalquery2

Page 8: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation
Page 9: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

JPIVOT

• Queries and cubes are stored in the folder webapps \ mondrian \ WEB-INF \ queries.– See the query: rentalquery2.jsp.– See the cube Sakila.xml

Page 10: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Create a cube for Sakila Data Warehouse

• Create a New Schema SakilaOlap.xml– Save in TOMCAT_HOME\webapps\mondrian\

WEB-INF\queries\– Configure the connection to the database with

user sakila_dwh.

Page 11: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Create a cube for Sakila Data Warehouse

• Create a cube named Rentals.– Add a fact table: link it to the table fact_rental– Add Customer dimension

Page 12: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Customer dimension

• Add the a hierarchy for Customer Dimension• Add the table: dim_customer• Add a level (Name) for hierarchy.

Page 13: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Customer dimension

Page 14: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Film dimension

• Add the a hierarchy for Film Dimension• Add the table: dim_film• Add a level (NameFilm) for hierarchy.

Page 15: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Film dimension

Page 16: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Date dimension

• Add the a hierarchy for Date Dimension• Add the table: dim_date• Add a level (Year) for hierarchy.• Add a level (Month) for hierarchy.

Page 17: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Date dimension

Page 18: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Date dimension

Page 19: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Add a Measure for the Cube

Page 20: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Add a Query

• Edit rentalquery2.jsp– Change: • jdbcUrl="jdbc:mysql://localhost/sakila_dwh?

user=sakila_dwh&password=sakila_dwh" • catalogUri="/WEB-INF/queries/Name.xml“

– Add the query: – select {[Measures].[Metrica1]} on columns,

{([Customer],[Date])} ON rows from Rentals– Reload Tomcat server.

Page 21: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Open JPIVOT

• Open http://localhost:8080/mondrian/testpage.jsp?query=rentalquery

• Answer the following questions:– Año y mes donde se realizaron mas ventas?– Cuantas rentas hizo el usuario en el 2005 (en que

meses?).

Page 22: Pentaho Mondrian OLAP CUBES. Installation Install Tomcat (version 5.0.25 or later). – Set JAVA_HOME Environment Variable pointed to SDK installation

Tarea

• Incluya todas las dimensiones del modelo estrella de sakila.

• Estudie las consultas MDX y construya dos consultas que incluyan la sentencia where y permitan explotar todas las dimensiones del cubo en jpivot.(http://msdn.microsoft.com/es-es/library/ms145514.aspx):