企业绩效管理网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 408|回复: 5

TM1 rule - Change of measures based on element selec ...

[复制链接]

82

主题

391

帖子

561

积分

中级会员

Rank: 3Rank: 3

积分
561
QQ
发表于 2014-3-20 04:27:05 | 显示全部楼层 |阅读模式
Hi All,

Can I write a rule in TM1 which enables to show 2 different measure values based on the element selected.

Eg : I have a period dimension which has members 2011, Jan, Feb,.. Dec (All are leaf level members)
I have loaded a particular measure for elements Jan to Dec, lets call it as 'Month Employee count' and only for 2011 element I have loaded a value 'Year employee count'.
Can I write a rule in TM1 for a measure 'Actual employee count' - which shows the value as 'Year employee count' when I select 2011 and for all other selections in period it should show 'Month Employee count'
Something like 'Actual employee count' = 'Year employee count If period = 2011 else 'Month Employee count'

Note : Here Year is not the aggregation or average of all months for this measure. Its basically the unique count of employees. Eg if there are 3 employee data line items for 3 different months then count should be 3(month wise), but when you take year the unique employee count is only 1. Thats why I am trying to load for 2 different measures

Regards
Sree
回复

使用道具 举报

64

主题

354

帖子

508

积分

中级会员

Rank: 3Rank: 3

积分
508
QQ
发表于 2014-3-20 05:30:17 | 显示全部楼层
Possibly try some variation on

['Actual Employee Count'] = IF( !Period @='2011', 'Year Employee Count', 'Month Employee Count');
回复 支持 反对

使用道具 举报

72

主题

369

帖子

522

积分

中级会员

Rank: 3Rank: 3

积分
522
QQ
发表于 2014-3-20 05:35:46 | 显示全部楼层
Or, using TM1's rule precedence:

Code: ['2011','Actual Employee Count'] = N: ['Year Employee Count'];
['Actual Employee Count'] = N: ['Month Employee Count'];

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

84

主题

404

帖子

581

积分

中级会员

Rank: 3Rank: 3

积分
581
QQ
发表于 2014-3-20 07:00:56 | 显示全部楼层
If you have month structure along with year information then you may write like this

['Actual Employee Count'] = N: IF( SCAN('2011',!Period) @='2011', 'Year Employee Count', 'Month Employee Count');
Or much faster if you have any unique numeric attributes to periods so that you may put your rule based on that numeric attribute in IF statement:
IF(Attrn('Period',!Period,'Numeric attributename') > 44 , 'Year Employee Count', 'Month Employee Count')

Thanks
回复 支持 反对

使用道具 举报

93

主题

423

帖子

624

积分

中级会员

Rank: 3Rank: 3

积分
624
QQ
发表于 2014-3-20 07:19:55 | 显示全部楼层
vinnusea wrote:
['Actual Employee Count'] = N: IF( SCAN('2011',!Period) @='2011', 'Year Employee Count', 'Month Employee Count');

Thanks

This won't compile as SCAN returns an integer as to where (position) the String is found.
回复 支持 反对

使用道具 举报

86

主题

397

帖子

589

积分

中级会员

Rank: 3Rank: 3

积分
589
QQ
发表于 2014-3-20 07:22:43 | 显示全部楼层
... that's not the only reason vinnusea's suggestion wouldn't compile!  The suggestion is also trying to assign one of 2 string values to a numeric cell.  What he actually meant was this:
Code: ['Actual Employee Count'] = N:
IF( SCAN('2011', !Period) >= 1,
  ['Year Employee Count'],
  ['Month Employee Count']
);

This would work (assuming a combined year-month dimension).  However in this kind of case my preference would be to go for qml's suggestion of using rule precedence.

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2018-1-23 07:35 , Processed in 0.150513 second(s), 11 queries , Memcache On.

Powered by Discuz! X3.1 Licensed

© 2001-2013 Comsenz Inc.

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