简体   繁体   English

SSAS 计算的度量不与其过滤的维度切片

[英]SSAS calculated measure not slicing with its filtered dimension

I have created a measure like this, the problem is it's not slicing with its own dimension.我已经创建了一个这样的度量,问题是它没有根据自己的维度进行切片。 Is it expected this way or am I missing something.是这样预期还是我遗漏了什么。 I am new to MDX scripting, any help would be highly appreciated.我是 MDX 脚本的新手,非常感谢任何帮助。

CREATE MEMBER CURRENTCUBE.[Measures].[CHARGE_CODE_TEST]
 AS Aggregate([Charege].[Station].&[CA2],[Measures].[Inv Line Amt]), 
VISIBLE = 1  ; 

在此处输入图像描述

CREATE MEMBER CURRENTCUBE.[Measures].[CHARGE_CODE_TEST]
     AS Aggregate({[Charege].[Station].&[CA1],[Charege].[Station].&[CA2]},[Measures].[Inv Line Amt]), 
    VISIBLE = 1  ; 

在此处输入图像描述

It should work like that - it works the way you wrote it - no matter against which member of [Charege].[Station] hierarchy you are looking [CHARGE_CODE_TEST] measure, it will always aggregate [Inv Line Amt] for the [Charege].[Station].&[CA2] in the first case, and CA1 and CA2 in the second case.它应该像那样工作 - 它按照你写的方式工作 - 无论你正在寻找[CHARGE_CODE_TEST]度量的[Charege].[Station]层次结构的哪个成员,它总是会聚合 [ [Charege].[Station].&[CA2][Inv Line Amt] ] [Charege].[Station].&[CA2]在第一种情况下,CA1 和 CA2 在第二种情况下。 If you remove these members from Aggregate function then it will show the numbers in the context of the current cell, like [Measures].[Inv Line Amt] does.如果您从聚合 function 中删除这些成员,那么它将在当前单元格的上下文中显示数字,就像[Measures].[Inv Line Amt]那样。

Try something like this for the first case:在第一种情况下尝试这样的事情:

CREATE MEMBER CURRENTCUBE.[Measures].[CHARGE_CODE_TEST]
 AS IIf([Charege].[Station].CurrentMember IS [Charege].[Station].&[CA2], ([Charege].[Station].&[CA2],[Measures].[Inv Line Amt]), 0)  , 
VISIBLE = 1  ; 

And, if I understood correctly, this should be the second case:而且,如果我理解正确的话,这应该是第二种情况:

    CREATE MEMBER CURRENTCUBE.[Measures].[CHARGE_CODE_TEST]
     AS IIf([Charege].[Station].CurrentMember IS [Charege].[Station].&[CA2]
OR [Charege].[Station].CurrentMember IS [Charege].[Station].&[CA1], ({[Charege].[Station].&[CA1],[Charege].[Station].&[CA2]},[Measures].[Inv Line Amt]), 0)  , 
    VISIBLE = 1  ; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM