Page 1 of 1
Using ATTRS in a TI process
Posted: Sun Mar 10, 2013 10:04 pm
by destry2
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!
Re: Using ATTRS in a TI process
Posted: Mon Mar 11, 2013 2:20 am
by tomok
Your syntax is not valid because your conditions are not inside an IF..ENDIF block.
Re: Using ATTRS in a TI process
Posted: Mon Mar 11, 2013 2:58 am
by rmackenzie
tomok wrote:Your syntax is not valid because your conditions are not inside an IF..ENDIF block.
Although most people use the IF..ENDIF block, the syntax is actually OK. Try this test code:
Code: Select all
nTest = 0;
IF ( nTest = 1,
AsciiOutput ( 'temp.txt', 'nTest is 1' ),
AsciiOutput ( 'temp.txt', 'nTest is not 1' ));
But most people write that:
Code: Select all
nTest = 0;
IF ( nTest = 1 );
AsciiOutput ( 'temp.txt', 'nTest is 1' );
ELSE;
AsciiOutput ( 'temp.txt', 'nTest is not 1' )
ENDIF;
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!
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:
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;
Re: Using ATTRS in a TI process
Posted: Tue Mar 12, 2013 1:12 pm
by destry2
Thanks for everyone's insight. Was able to get it to work - I was not referencing my variable correctly. Thanks