2

I want to make some Calculated Measures in my cube that conditionally use a value from the measure table, based on a dimension attribute value.

For example: where Document Status in the Document dimension is CP, use the Committed Value measure. This is what I have for that:

CREATE MEMBER CURRENTCUBE.[Measures].CalcCommittedValue
 AS ([Document].[Document Status].&[CP], [Measures].[Committed Value]), 
FORMAT_STRING = "$#,##0;-$#,##0", 
VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'Document Total'  ;   

And it looks like it works, until I start browsing the cube and put Document Status and CalcCommittedValue into the Browser. All the options for Document Status display the same CalcCommittedValue.

Thanks for your help!

4

1 回答 1

1

要正确执行此操作,请尝试使用 SCOPE() 语句...例如

CREATE MEMBER CURRENTCUBE.[Measures].[CalcCommittedValue]
AS

  SCOPE([Document].[Document Status].[&CP]);

   THIS = [Measures].[Committed Value];

  END SCOPE;

只要存在 [CP] 的文档状态,则范围声明将导致计算值,否则不计算。非常强大的声明,应该得到你想要的。

于 2013-10-30T00:30:54.183 回答