IBM Cognos Report Studio: Arbitrary errors when using IF / CASE on an TM1 cube

这一生的挚爱 提交于 2019-12-11 04:14:39

问题


I am having some trouble with an IF / CASE expression when consuming a TM1 cube in Report Studio.

I am "filtering" a crosstab with a tuple function that includes an element from the "branch" dimension. The users can navigate through this branch hierarchy by a value prompt I have made.

Hence, the users have requested that they at every time can see where they are in the branch hierarchy (i.e. see the path from root to current node).

I have therefore tried to make two query expressions which at all times represents the current node, and the current level:

[CurrentBranch]:

#prompt('pBranch', 'MUN', '[Cube].[Dimension].[Hierarchy].[Level]->:[TM].[Dim_Branch].[Dim_Branch].[@MEMBER].[49981]')#

[CurrentLevel]:

ordinal(level([CurrentBranch]))

Both of these are working as intended. However, when I try to utilize IF / CASE statements in order to display the correct amount of parents, I get all kinds of arbitrary errors. An example would be a [FirstParent] expression:

IF ([CurrentLevel] > 1) THEN
    (roleValue('_memberCaption', parent([CurrentBranch])))
ELSE
    ('')

It produces the following error...

Data size error. The data type is 'cclDTypeExternalBuffer'.

...when [FirstParent] is added to a layout calculation.

If I change the expression to (just to test the IF statement):

IF (1 > 0) THEN
    (roleValue('_memberCaption', parent([CurrentBranch])))
ELSE
    ('')

The same error is shown. If I then change the statement to

IF (1=0) THEN
    (roleValue('_memberCaption', parent([CurrentBranch])))
ELSE
    ('')

or

IF (1=1) THEN
    (roleValue('_memberCaption', parent([CurrentBranch])))
ELSE
    ('')

No error is shown, and the result is correct.

However, if I now change the expression to:

IF ([CurrentLevel]=1) THEN
    (roleValue('_memberCaption', parent([CurrentBranch])))
ELSE
    ('')

...then the same error is show again.

Data size error. The data type is 'cclDTypeExternalBuffer'.

I have tried to wrap the [CurrentLevel] inside various common functions that are supported when working with OLAP (e.g. abs()), however, no luck there.

Any ideas why this is happening and how to fix it?

This really reaches beyond my understanding.

Thanks for ANY input!


回答1:


Found this explanation, saying that "Report expressions are designed to access parameters and report session properties; using them to access query items can be error prone." Report expression is then what I referred to as layout calcualations

http://www-01.ibm.com/support/docview.wss?uid=swg21340596

Hence, I unlocked the report and included the data items directly. This way everything was working as intended.



来源:https://stackoverflow.com/questions/20700555/ibm-cognos-report-studio-arbitrary-errors-when-using-if-case-on-an-tm1-cube

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!