企业绩效管理网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1365|回复: 3

Using ATTRS in a TI process

[复制链接]

74

主题

392

帖子

562

积分

高级会员

Rank: 4

积分
562
QQ
发表于 2014-6-28 03:55:21 | 显示全部楼层 |阅读模式
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!
回复

使用道具 举报

80

主题

401

帖子

588

积分

高级会员

Rank: 4

积分
588
QQ
发表于 2014-6-28 05:50:47 | 显示全部楼层
Your syntax is not valid because your conditions are not inside an IF..ENDIF block.
回复 支持 反对

使用道具 举报

77

主题

412

帖子

590

积分

高级会员

Rank: 4

积分
590
QQ
发表于 2014-6-28 05:52:38 | 显示全部楼层
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: nTest = 0;
IF ( nTest = 1,
   AsciiOutput ( 'temp.txt', 'nTest is 1' ),
   AsciiOutput ( 'temp.txt', 'nTest is not 1' ));
But most people write that:Code: 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: 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;

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

85

主题

419

帖子

604

积分

高级会员

Rank: 4

积分
604
QQ
发表于 2014-6-28 06:10:46 | 显示全部楼层
Thanks for everyone's insight. Was able to get it to work - I was not referencing my variable correctly. Thanks
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|企业绩效管理网 ( 京ICP备14007298号   

GMT+8, 2022-11-27 00:34 , Processed in 0.078866 second(s), 11 queries , Memcache On.

Powered by Discuz! X3.1 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表