Greetings everyone,
I am new to TM1 and have a very simple question (hopefully). I'm trying to copy data between two views in the same cube using a TI process. I would like to map one dimension to one of its attributes. Is this possible? I tried doing this but get the error that "Dimensionname is not allowed". My syntax is:
if (VALUE_IS_STRING=1,
CellPutS(SVALUE,Cube,vVersion,ATTRS('Account',Account,'NewAccount'),vProduct,vMeasure),
CellPutN(NVALUE, Cube, vVersion,ATTRS('Account',Account,'NewAccount'),vProduct,vMeasure));
Thanks for any help!
Using ATTRS in a TI process
-
- 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: Using ATTRS in a TI process
Your syntax is not valid because your conditions are not inside an IF..ENDIF block.
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Using ATTRS in a TI process
Although most people use the IF..ENDIF block, the syntax is actually OK. Try this test code:tomok wrote:Your syntax is not valid because your conditions are not inside an IF..ENDIF block.
Code: Select all
nTest = 0;
IF ( nTest = 1,
AsciiOutput ( 'temp.txt', 'nTest is 1' ),
AsciiOutput ( 'temp.txt', 'nTest is not 1' ));
Code: Select all
nTest = 0;
IF ( nTest = 1 );
AsciiOutput ( 'temp.txt', 'nTest is 1' );
ELSE;
AsciiOutput ( 'temp.txt', 'nTest is not 1' )
ENDIF;
I would check that the values for Cube, vVersion, Account, vProduct and vMeasure are all genuine elements in their respective dimensions - and that Cube is really the name of the cube. Then check that the values for NewAccount are also element names. Use an AsciiOutput to do the debugging:destry2 wrote:I'm trying to copy data between two views in the same cube using a TI process. I would like to map one dimension to one of its attributes. Is this possible? I tried doing this but get the error that "Dimensionname is not allowed". My syntax is:
if (VALUE_IS_STRING=1,
CellPutS(SVALUE,Cube,vVersion,ATTRS('Account',Account,'NewAccount'),vProduct,vMeasure),
CellPutN(NVALUE, Cube, vVersion,ATTRS('Account',Account,'NewAccount'),vProduct,vMeasure));
Thanks for any help!
Code: Select all
sNewAccount = ATTRS('Account',Account,'NewAccount');
AsciiOutput ( 'temp.txt', Cube, vVersion, Account, sNewAccount, vProduct, vMeasure );
IF (VALUE_IS_STRING=1 );
CellPutS(SVALUE,Cube,vVersion,sNewAccount,vProduct,vMeasure);
ELSE;
CellPutN(NVALUE, Cube, vVersion,sNewAccount,vProduct,vMeasure);
ENDIF;
Robin Mackenzie
-
- Posts: 5
- Joined: Sun Mar 10, 2013 9:55 pm
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2007
Re: Using ATTRS in a TI process
Thanks for everyone's insight. Was able to get it to work - I was not referencing my variable correctly. Thanks