The Analytics infrastructure can be installed by the Analytics Module, or any other Module that has a dependency from it, like the Multi-Dimensional Financial Reports such as Multi-Dimensional Profit and Loss or Multi-Dimensional Trial Balance.
As System Administrator access the Window General Setup || Application || Module Management. There, it is possible to install new modules by clicking on Add Modules.
Search for this module, named Analytics and install it. The system must be rebuilt after the installation.
The Openbravo instance must be in MP27.1 or above.
Note. If using an Appliance take into account that Analytics only work with the new Appliances based on Ubuntu, not in the old ones based on rPath technology.
Openbravo Analytics uses Mondrian on the server. Mondrian reads query results completely in memory before sending them to the client. This means that your server must have enough memory to load the data of the largest query you expect in memory.
For smaller instances with smaller datasets: 1Gb of memory for the application/Tomcat process should normally be enough, for mid- and larger instances 4Gb or more is advised.
For larger instances: as Mondrian fires/uses sql queries to load data it can make sense to host the Openbravo database on a separate server, to share the load between the application and database server.
Mondrian's memory management ensures that when a query is too large to fit in memory that the query is stopped and an error is shown to the user. The memory which was used by the query is freed in this case.
Mondrian has an advanced caching mechanism which caches query results in memory so that they can be served directly from memory. The Mondrian cache uses so-called weak references, this means that they can not result in out-of-memory exceptions, if the system needs memory the Mondrian cache is automatically purged.
Once the Module has been installed, it is necessary to give access to OB Analytics to the Roles that should have it. This can be done through the Role Window. In the View Implementation Tab create a record with OBANALY_SaikuView as the View Implementation.
With the Module there is also a dataset included that gives access to this Window to the F&B Administrator Role. The step above can be skipped by using this dataset.
Note. This dataset only applies to F&B data, if F&B Client is not installed it will not work.
Configuring Standard Mondrian Integration Processes
When running Openbravo Analytics there are several processes which must be scheduled to run in the background.
Periodic (Daily) Processes
Several processes should run periodically, probably daily. The processes should be run/scheduled in the order described here.
Creating time dimensions and parent-child relations
Fact Table Create & Update Process
Fact Table Updating Process (as Client Admin Role). This process can take several hours if run initially or after the fact tables have been cleared. For example 600000 invoice lines takes 3-4 hours to run. After an initial run to fill the fact tables, subsequent daily runs will only update the fact table with changes. This daily run takes most of the time only a few minutes.
Fact Table Create & Update Process Configuration
It is possible to configure the calculation of the fact table records to generate just the fact records that belongs to a particular range of time. It is also possible to define a batch size which defines the maximum amount of records to be calculated on every execution of the process.
Thus, it is possible to schedule the process to be executed along different days, during those hours where the system has less overload (for example at night).
For this reason, this process has been split into two:
- Forward Update Analytics Fact Tables: calculates the data of the fact tables for a period starting from a date forward.
- Backward Update Analytics Fact Tables: calculates the data of the fact table from an ending date backwards.
This process can be scheduled as usual, using the Process Request window. But they require to be configured previously.
To configure them, the Analytics Process Configuration window must be used.
These are the fields that can be populated:
- Forward Start Date: the fact table records to be taken into account will be those which are subsequent to this date.
- Forward Batch Size: number of records that will be processed on each execution of the Forward Update Analytics Fact Tables Process.
- Backward Start Date: if defined, the fact records previous to this date will be calculated also. This field will be displayed just if the Forward Start Date is defined.
- Backward Batch Size: number of records that will be processed on each backwards execution. It will be displayed just if the Forward Start Date is defined.
If there is not a configuration defined for the current client, it will try to recover a configuration from the System client. If not found, then:
- The Forward Update Analytics Fact Tables process will calculate all the new fact data.
- The Backward Update Analytics Fact Tables process will not execute any action.
Finance Dimensional Fact Tables
When the finance dimensional modules are also installed then these background processes should also be scheduled:
Cache Preloading Process (as Client Admin Role)
On Demand - Clearing Fact Table
Fact Table Clearing Process (as Client Admin Role) to completely rebuild the fact tables, this process can be used to clear the fact tables, the update process will then completely rebuild the fact tables. The clear process should not run automatically but only on demand. As it will result in the update process to do a full rebuild. Depending on the size of the database this can take a long time, therefore clearing and updating the fact tables from scratch should be done in hours with low load on the system.
The screenshots above illustrate how this Process should be configured.
Advanced Configuration: Configuring Mondrian
Mondrian can be configured through a mondrian.properties file with properties in the root of the classpath. Openbravo Analytics is published with a default set of properties, these can be found in the Modules:Analytics_Configuration mondrian.default.properties file. If another module provides a mondrian.properties file in the root of the classpath then this file is used instead of the Openbravo mondrian.default.properties file.
For more detailed information about the correct configuration of Mondrian, please refer to the related section in the Documentation.