Example Business Rule

  • In this example, we added five year-to-date members to the Account dimension: "4110_UTD", "4120_YTD", "4130_YTD", "4140_YTD", "4150_YTD". We then created a business rule:


    Example business rule that has five year-to-date members added to the Account dimension

    This business rule calculates two YTD accounts and then aggregates the values through the Product and Entity dimensions.

  • Looking at the log messages with Pass Only selected, we can see that most of the rule time is taken with the first pass.


    Log messages with Pass Only selected

  • Deselecting Pass Only allows us to see the number of block reads/writes in the pass1 section of the logs.


    Log Messages with Pass Only deselected

  • Reviewing the syntax, we can see that the calculation does not have a fix on Entity and Product; therefore, all of the rule is being performed on all the levels of Entity and Product. There is not requirement to calculate upper levels in pass1 because these will be overwritten by the AGG statement in the second pass anyway.


    Screenshot showing that the calculation does not have a fix on Entity and Product.

  • The rule is reviewed and an extra Fix statement is added to add lev0 of Entity and Product to Pass1.


    Rule shown with an extra Fix statement added to add lev1 of Entity and Product to Pass1

  • The rule is then run again.

  • With the change, Pass1 still takes the longest time, but now is 20% faster because upper level blocks are no longer calculated unnecessarily. The overall calculation time also improves by 20%.


    Log Message tab showing a 20% faster calculation time.

  • Deselecting Pass Only, we can see that the number of blocks, reads, and writes in the Pass1 section of the logs goes down after the change.


    Screen shot showing the calculator information message before the rule change


    Screen show showing the calcuator information message after the rule change

  • This reduces the reads and writes for the overall business rule (both passes), as we can see in the Activity Report.


    Screen shot showing the top 5 worst performing calc scripts before the rule change and after the rule change