Epilog: The Limitation that went Unnoticed
Posted: Mon Jan 10, 2011 10:58 am
Ever since i started using TM1 i was always under the impression that TI code worked in any tab, it just did the job differently depending on which one. Today i have found out that is not the case for at least one function, and probably more.
I had a process where i wanted to list the names of cubes and dimensions that met certain criteria in 2 temporary dimensions. The plan was to then use this list in another process to destroy those cubes / dims. A simple piece of code went in to prolog to list the cubes, and an identical piece in epilog to list the dims. i only did this to keep things tidy and easy to read, i could do it all in prolog but this is where i found the limitation.
DimensionElementInsert does not work in epilog. Even using SaveDataAll at the end makes no difference, it never does the task. Even an asciioutput confirmed the code was being run and the parameters were correct, but TI refuses to do the task. I then made a simple check using this code;
PROLOG
EPILOG
The epilog will not add test2 as an element. If all the code is in prolog it will run fine.
I have tested this in 9.0 and 9.5.1 with the same results. At the very least nuances like this should be mentioned in the documentation for the function, and who knows what other functions are limited this way. Does anyone have any other examples of functions where this happens, or a version of TM1 where it doesn't?
I had a process where i wanted to list the names of cubes and dimensions that met certain criteria in 2 temporary dimensions. The plan was to then use this list in another process to destroy those cubes / dims. A simple piece of code went in to prolog to list the cubes, and an identical piece in epilog to list the dims. i only did this to keep things tidy and easy to read, i could do it all in prolog but this is where i found the limitation.
DimensionElementInsert does not work in epilog. Even using SaveDataAll at the end makes no difference, it never does the task. Even an asciioutput confirmed the code was being run and the parameters were correct, but TI refuses to do the task. I then made a simple check using this code;
PROLOG
Code: Select all
DimensionCreate( '_TempKillCubes' );
DimensionElementInsert ( '_TempKillCubes' , '' , 'test1' , 'N' );
Code: Select all
DimensionCreate( '_TempKillDims' );
DimensionElementInsert ( '_TempKillDims' , '' , 'test2' , 'N' );
I have tested this in 9.0 and 9.5.1 with the same results. At the very least nuances like this should be mentioned in the documentation for the function, and who knows what other functions are limited this way. Does anyone have any other examples of functions where this happens, or a version of TM1 where it doesn't?