I recently worked with an IBM Planning Analytics client to optimize a model that uses a check value to determine when to do further calculations. The check typically resulted in either a one or a zero and a series of rules were written as follows:
[‘x’] = N: IF ( [‘check’] = 1, the calculation, CONTINUE)
Many of you know that while IF checks are easy to write and easy to understand (and therefore maintain), they are also slow and could have an impact on the performance of larger cubes. As a result, we updated the rules to use the following approach:
[‘x’] = N: the calculation * [‘check’]
This approach initially worked great since we updated the calculation to simply multiply the result by a one or a zero. But after further analysis, we learned that the check value is not always Boolean … which meant that the current formula sometimes required “greater than or equal” instead of simply using “equal.” This also meant that we could not use the check value as a multiplier since it would increase the end result.
So how did we solve this? We made the new formula force the check value into a one or zero! We did this by updating the rule to use the following approach:
[‘x’] = N: the calculation * [‘check’] \ [‘check’]
The result of “check divided by check” ensured that the value is always one or zero. And by using the back slash (top left to bottom right), we ensured that the value never results in a divide-by-zero error.
This approach helped optimize the client’s rule while also ensuring that the logic still worked properly.
IBM Planning Analytics, which TM1 is the engine for, is full of new features and functionality. Not sure where to start? Our team here at Revelwood can help. Contact us for more information at firstname.lastname@example.org. And stay tuned for more Planning Analytics Tips & Tricks weekly in our Knowledge Center and in upcoming newsletters!