I like to import Data to a Cube. There could be the case that the data of the source file doesn't have all the same elements in the dimensions like the target cube. Thats why I like to check first if the element of the dimension exists in the target dimension.
If a Dimension exists I can easily check using "DimensionExists(DimName)", but is there a way to check if the element of the dimension exists before putting the data in the cube. I don't wanna get an error in the logfile so I like to catch the error in the code.
I wrote the following lines... But I think it is a little too complicated. Isn't ther something out of the box in TM1?
Explanation: Cube with two dimensions (abc and Country). For the Dimension abc I check if the current element exists in the target dimension.
Code: Select all
run = 1;
bFound = 'FALSE';
WHILE(DIMSIZ('abc') >= run);
IF(vAbc @= DIMNM('abc', run));
CellPutN( vValue, 'cubeVerhalten', vCountry, vAbc);
bFound = 'TRUE';
BREAK;
ENDIF;
run = run + 1;
END;
IF(bFound @<> 'TRUE');
AsciiOutput ('D:\TM1\TM1Data\TestDominik\Beispielanwendungen\import file\fehler.csv', vAbc);
ENDIF;