Hi Everyone,
I need to get a list of all elements & its attributes in each dimension, and put them all in a table (Excel).
How can I do this?
lee
Get a list of element attributes in each dimension
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Get a list of element attributes in each dimension
One by one, open the }ElementAttributes cube for each dimension, put the elements on rows and attributes on columns (or vice versa) and click on the snapshot icon.
-
- Posts: 19
- Joined: Fri Nov 21, 2014 5:01 pm
- OLAP Product: tm1
- Version: 10.1
- Excel Version: 2010
Re: Get a list of element attributes in each dimension
There's gotta be a way to write a ti process to automate the whole procedure and store it in a cube, right?
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Get a list of element attributes in each dimension
If you only need it for 1 dimension then open the element attributes cube and do a slice, snapshot or active form. If you actually want it for every dimension then I'm sure that code similar to below will be in the forum somewhere if searching:elee123 wrote:There's gotta be a way to write a ti process to automate the whole procedure and store it in a cube, right?
Code: Select all
DataSourceAsciiQuoteCharacter = '';
sDirectory = GetProcessErrorFileDirectory;
sDimDim = '}Dimensions';
iCount = 1;
iMax = DimSiz ( sDimDim );
While ( iCount <= iMax );
sDimName = DimNm ( sDimDim, iCount );
If ( SubSt ( sDimName, 1, 1 ) @<> '}' );
sCubAttr = '}ElementAttributes_' | sDimName;
sFileOutput = sDirectory | sDimName | '.txt';
iColCount = 1;
If ( CubeExists ( sCubAttr ) = 0 );
iColMax = 0;
Else;
iColMax = DimSiz ( sCubAttr );
EndIf;
sHeader = 'Element';
While ( iColCount <= iColMax );
sHeader = sHeader | ',' | DimNm ( sCubAttr, iColCount );
iColCount = iColCount + 1;
End;
AsciiOutput ( sFileOutput, sHeader );
iElementCount = 1;
iElementMax = DimSiz ( sDimName );
While ( iElementCount <= iElementMax );
sElementName = DimNm ( sDimName, iElementCount );
sRowOutput = sElementName;
iColCount = 1;
While ( iColCount <= iColMax );
sRowOutput = sRowOutput | ',' | CellGetS ( sCubAttr, sElementName, DimNm ( sCubAttr, iColCount ) );
iColCount = iColCount + 1;
End;
AsciiOutput ( sFileOutput, sRowOutput );
iElementCount = iElementCount + 1;
End;
EndIf;
iCount = iCount + 1;
End;
Declan Rodger