以下是Adventure Works的一个简单示例:
with
member test1 as sum([Measures].[Internet Sales Amount])
- [Customer].[Customer].&[28187]
member test2 as sum([Measures].[Internet Sales Amount])
- sum([Customer].[Customer].&[28187],[Measures].[Internet Sales Amount])
member test3 as sum
(
{[Customer].[Customer].children - [Customer].[Customer].&[28187]},
[Measures].[Internet Sales Amount]
)
select {test1, test2, test3} on 0
from [Adventure Works]
结果几乎相同,除了“test1”具有非货币类型格式
问题:
“test1”calc-member:如何从“sum”的数值结果中减去“Customer”成员表达式?这看起来不合逻辑,令人心碎。我希望算术减法,设置减法,但不是算术减法的成员...
所有(test1,test2,test3)计算成员的逻辑和“性能”是否相等?如果没有,“test1”成员的正确显式形式是什么?看起来“test2”在大多数情况下表现更好,因为“test3”集减法可能会导致非常大的集合。
答案 0 :(得分:2)
“test1”与“test2”相同。
正确的显式形式是
member test as ([Measures].[Internet Sales Amount])
- ([Measures].[Internet Sales Amount], [Customer].[Customer].&[28187])