|
发表于 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
|