企业绩效管理网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1398|回复: 5

Loading many measures

[复制链接]

73

主题

386

帖子

554

积分

高级会员

Rank: 4

积分
554
QQ
发表于 2014-6-17 05:49:54 | 显示全部楼层 |阅读模式
Close but no cigar.. any ideas how to get the value in the source file?
I had too many measures to define so decided to loop it.. it works except for what's highlighted below:

iMeasure = DIMSIZ('ABM Measures');

i=1;

While (i<=iMeasure);

vElement = DIMNM('ABM Measures',i);

vValue = ?the value matching the name of vElement in the source data file?

IF(vElement @<> 'Expense' % vElement @<> 'Revenue');
IF(CellIsUpdateable('ABM', 'Actual', quarter, ctyp11, fundsor, pattyp, vWard, diag, vElement)=1);
nGetVal = CellGetN('ABM', 'Actual', quarter, ctyp11, fundsor, pattyp, vWard, diag, vElement);
CellPutN(nGetVal + vValue, 'ABM', 'Actual', quarter, ctyp11, fundsor, pattyp, vWard, diag, vElement);
ENDIF;
ENDIF;

i=i+1;

END;
回复

使用道具 举报

84

主题

399

帖子

588

积分

高级会员

Rank: 4

积分
588
QQ
发表于 2014-6-17 07:28:16 | 显示全部楼层
AFAIK, this isn't possible in TM1.
An IF structuur with multiple ELSEIF's will be your best bet.
For the future, can you please use [CODE] tags to format your code here? Thanks.
回复 支持 反对

使用道具 举报

64

主题

373

帖子

515

积分

高级会员

Rank: 4

积分
515
QQ
发表于 2014-6-17 07:59:19 | 显示全部楼层
Surely it must be possible.. it's all possible in TM1 right..?  

The structure works - the only thing I struggle to do is get the Value for the relevant variable.. it's in the record, I just don't know how to pick it out..

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

67

主题

407

帖子

573

积分

高级会员

Rank: 4

积分
573
QQ
发表于 2014-6-17 09:02:18 | 显示全部楼层
Have a look at the EXPAND function, if you can make it work, please leave me a note
But don't tell me I did not warn you you'd lose your time investigating this one. Others were there before you.

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

77

主题

392

帖子

558

积分

高级会员

Rank: 4

积分
558
QQ
发表于 2014-6-17 09:10:21 | 显示全部楼层

Looks like this is what you want.

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

66

主题

394

帖子

543

积分

高级会员

Rank: 4

积分
543
QQ
发表于 2014-6-17 09:38:48 | 显示全部楼层
I just finished replying and see David and Wim already pointed you to the same direction in the meantime, but in less detailed way, so I will let myself submit the post anyway .
***

First of all, please note, that the codition here will always be true:
Code: IF(vElement @<> 'Expense' % vElement @<> 'Revenue');
I assume you wanted it to be:
Code: IF(vElement @<> 'Expense' & vElement @<> 'Revenue');
There is a chance you wanted it to be this:
Code: IF(vElement @= 'Expense' % vElement @= 'Revenue');
But this does not change much, both cases will work with below code.

Whatever measure names you have in your source columns, give variables for those columns meaningful names. For example for measure Sales give a name vValueSales, for measure Expense make it vValueExpense etc.

In such a case you could change your code to something like this:

Code: iMeasure = DIMSIZ('ABM Measures');

i=1;

While (i<=iMeasure);

  vElement = DIMNM('ABM Measures',i);

  IF(vElement @<> 'Expense' & vElement @<> 'Revenue');
    vValue = Expand ( '%vValue' | vElement | '%' );
    IF(CellIsUpdateable('ABM', 'Actual', quarter, ctyp11, fundsor, pattyp, vWard, diag, vElement)=1);
      nGetVal = CellGetN('ABM', 'Actual', quarter, ctyp11, fundsor, pattyp, vWard, diag, vElement);
      CellPutN(nGetVal + vValue, 'ABM', 'Actual', quarter, ctyp11, fundsor, pattyp, vWard, diag, vElement);
    ENDIF;
  ENDIF;

  i=i+1;

END;


Above example is not tested, so you might need to change it in some way. Generally it uses a concept of very useful .

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2023-5-31 05:36 , Processed in 0.077126 second(s), 38 queries .

Powered by Discuz! X3.1 Licensed

© 2001-2013 Comsenz Inc.

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