Product:
Planning Analytics 2.0.9
Microsoft Windows 2019 server
Issue:
How read in the dimension elements and hierarchy from a text file?
Solution:
Create a csv file where you have on every row one element, and all its sub-elements before it.
In our example we have a 4 sub-element deep dimension.
You have to use your name of the elements in the dimension.
Create a new TM1 TI process, that take parameters for the dimension to update and where the file is located.
Pick up the file in Data Source tab, and setup the variables as “other”.
Variable names could be of that kind that it is easy to understand what they show.
Create a proplog code to get the dimension or the path from a cube if the parameters is blank:
sSubset = '$.'|getProcessName(); # if parameter is blank - get value from sys cube IF ( LONG (pDim) <= 0 ); # get the values from sys settings cube pDim = cellgets('sys.Settings','DimtoUpdate','Value'); pPath = cellgets('sys.Settings','FiletoImport','Value'); ENDIF; # set the values from parameters sDim = pDim ; DataSourceNameForServer = pPath ; DataSourceNameForClient = pPath ; # set the format of the file DatasourceASCIIQuoteCharacter = ''; DatasourceASCIIDelimiter = ';';
Create in metadata section, that insert the elements into the dimension:
DIMENSIONELEMENTINSERT( pDim ,'',V1,'c'); DIMENSIONELEMENTINSERT( pDim ,'',V2,'c'); DIMENSIONELEMENTINSERT( pDim ,'',V3,'c'); DIMENSIONELEMENTCOMPONENTADD( pDim ,V1,V2,1.000000); DIMENSIONELEMENTCOMPONENTADD( pDim ,V2,V3,1.000000); DIMENSIONELEMENTCOMPONENTADD( pDim ,V3,V4,1.000000);
There is more ways to do this – but this is maybe the simplest way.
More Information:
https://www.wimgielis.com/tm1_tm1_EN.htm
https://vrgultom.wordpress.com/2013/08/13/updating-attribute/
https://intellipaat.com/blog/tutorial/cognos-tm1/dimensions-and-cubes/
https://www.bihints.com/dimensions_updates_mapping
https://tm1up.com/3-dimensions-in-tm1.html