I reference this handy document often: 7 tips to writing faster IBM TM1 and Planning Analytics rules. Additionally, I've begun to use Cubewise Pulse (great tool!) which includes a nifty feature that scans your rules and compares it to their best practices.
There is a best practice recommendation that I wanted to run by tm1f.
We have a time dimension that is solely year based: 2020, 2021, 2022, etc.
- The way I approach previous year in a rule is: DB( ... STR(NUMBR(!Year)-1,4,0) ... )
- The way I approach next year in a rule is: DB( ... STR(NUMBR(!Year)+1,4,0) ... )
However, the Cubewise Pulse best practice says that string functions are slow and I should instead use an attribute lookup.
So for 2021, store Next Year attribute of 2022, etc, then lookup e.g. DB( ... DB('}ElementAttributes_Year', !Year, 'Next Year') ... )
Question to tm1f ... how do you go about this, and what, in your experience is faster for the tm1 server?