Hi team, today we will talk about keeping your OLAP (Online Analytical Processing) rules up-to-date in a dynamic environment where data changes frequently. Jedox, a powerful platform for planning, analytics, and reporting, allows users to refresh or update rules easily from the spreadsheet server in case your business rules are set in that way. In this post, we’ll dive into how you can use a simple PHP function to refresh rules for a specified database and cube.

Why Refresh Rules?

In Jedox, rules define how data is calculated within a cube. For instance, you might have rules that calculate ‘Price’ or ‘Units’ in a sales-related cube. When underlying data or logic changes, these ones need to be recalculated or refreshed to ensure the accuracy of your reports and dashboards.

The Code Explained

Here’s a look at a simple function that makes the refresh in Jedox:

function _Refresh_Click()
{
$host = $_JEDOX['OLAP_HOST'];
$port = $_JEDOX['OLAP_PORT'];
$conn = palo_init($host, $port, $_JEDOX['OLAP_SESSION_ID']);

$database = "Biker";
$cube = "Orders2";

palo_cube_refresh_template_rules($conn,$database
,$cube);
palo_cube_refresh_template_rules($conn,$database,$cube);

//return __msgbox("Rules are updated", 'Warning', 'Warning');
}

This code is part of a broader application, typically executed when you need to update them manually.

Breaking Down the Function

  1. Connection Initialization:
    • The function starts by initializing a connection to the OLAP server using the palo_init function. It pulls the host, port, and session ID from predefined global variables ($_JEDOX['OLAP_HOST'], $_JEDOX['OLAP_PORT'], and $_JEDOX['OLAP_SESSION_ID'] respectively).
  2. Refreshing :
    • The function then calls palo_cube_refresh_template_rules, specifying the connection, the database (Biker in this case), and the specific cubes Orders2. This function refreshes the rules associated with these cubes, ensuring that any updates to the underlying data are reflected accurately.
  3. User Notification:
    • Finally, the function returns a message box (__msgbox) indicating that the rules have been updated. The parameters passed to this function define the message type and title.

Conclusion

Refreshing business logic in Jedox doesn’t have to be a manual, time-consuming process. With the right code, you can ensure that your OLAP cubes reflect the most current data, providing accurate insights and analysis. This simple PHP function is a powerful tool in your Jedox toolkit, especially in environments where data changes frequently and needs to be recalculated often.

Don’t miss out post about version blending.

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave the field below empty!