Quantcast
Channel: Pentaho – Francesco Corti
Viewing all articles
Browse latest Browse all 39

Developing a smart filter for Pentaho dashboards

$
0
0

In this post is described the development of a smart filter using the Pentaho CDE dashboards of the Pentaho Analytics Platform. The smart filter is presented in a first initial version, defined as a single level filter. The post is developed as a step by step description on how to reach the goal.

In this post I would like to share the development of a more advanced filter, different from the default and well-known drop-down menus, check-boxes, ecc. The goal is to make the developers able to design results more advanced and modern, respect to the awful dashboards that sometimes I see. 😉

The goal

One of the most useful features of the Pentaho suite is that you can develop your own dashboards and analytics with a real framework, ready to use. Usually the dashboards are defined by charts, tables or several other components but often the interaction with them requests the development of filters, menus or configuration components.

In this post is shared an example of smart filter based on a mondial database, useful for the purpose of the demo. The goal is to develop a filter on a simple chart that lists the first ten languages spoken in every continent of the world.

Preparing the environment

All the development has been on the platform described below.

  • Operating System: Linux Ubuntu 14.04.LTS (vanilla installation).
  • Java v1.7.0._65 (installed with ‘sudo apt-get install default-jre’).
  • MySql and Workbench (installed with ‘sudo apt-get install mysql-server mysql-workbench’).
  • Pentaho Analytics Platform v5.2 (tested also on v5.0 and v5.1).

In the version of the Pentaho Analytics Platform I used, I had to update the Community Dashboards Framework (CDF), the Community Data Access (CDA) and the Community Dashboard Editor (CDE) to the latest TRUNK version because of some relevant bugs. This task is easy to develop using the Pentaho Marketplace… very easy to use with a single ‘click and restart’ approach. 😉

Preparing the “mondial” database

Before developing the dashbards, the database should be set. For testing purpose I choose the MONDIAL database from Georg-August-Universität of Göttingen. It has been very complete and interesting to use. 😉

There you can find an interesting and complete Entity-Relational structure documented. There a lot of available versions of the database and I tried the MySql one.

To prepare the database there are two different scripts to run using the MySql Workbench:

My choice was to focus the tests on the portion of the schema that defines the Continents that contain the Countries, with several languages spoken. Below the portion of the schema used in the development.

Mondial-ER

Presentation of the dashboard

As described before in the post, the dashboard develops a filter on a simple chart that lists the first ten languages spoken in every continent of the world. I think that a video that shows the interaction with the user is preferable to a boring description. Below the video that shows the final result.

The technical approach

The result described before can be obtained working around two main components, you can manage using the Community Dashboard Editor (CDE), in particular the Components Layer describe below.

smart_filter

More in detail, the result can be obtained working on the components described below:

  • The Popup component with id ‘filterGeoPopupComponent’, hidden in the ‘hiddenPopups’ row of the HTML layer.
  • The Button component with id ‘filterGeoButton’ that shows the popup using the javascript function described below, once is pressed.
function f(e) {
 render_filterGeoPopupComponent.popup($(e.target));
}

Into the Popup component, the Multiple select component with id ‘filterGeoLevel1Component’ is the real filter of the Continent.

Source code

Last but not least, I would like to share the source code of the dashboard to make everyone able to check the technical details. The zip file you can download here, contains the three files below.

  • smart_filter_1.cda
  • smart_filter_1.cdfde
  • smart_filter_1.wcdf

To try (and use) it, simply upload the files into the repository using the Pentaho Analytics Platform interface (Browse button), and open the wcdf.

Conclusion

In this post is described the development of a smart filter using the Pentaho CDE dashboards of the Pentaho Analytics Platform. The goal is to develop a one-level filter on a simple chart that lists the first ten languages spoken in every continent of the world. The goal is to make the developers able to design dashboards more advanced and modern.

The post Developing a smart filter for Pentaho dashboards appeared first on Francesco Corti.


Viewing all articles
Browse latest Browse all 39

Trending Articles