MDX 中的汇总:计算成员覆盖实际度量
[measures].[Alert Count] 是一个真实的度量(基于事实表中的列)。
CREATE MEMBER CURRENTCUBE.[Measures].[test6] as [measures].[Alert Count];
([Store].[Store].[Store].members*[Calendar].[Date].[Date].members ,[measures].[test6]) = 2;
由于最后一个范围分配将 test6 的度量覆盖为 2,因此我希望以下内容为 test 的每个单元格返回 4,因为我们用 2 个日期进行切片,并且每天都有一个 test6 作为 2,然后汇总得到 2+2= 4.但实际结果并非如此:test6 始终等于[alert count]。
select {[Measures].[test6],[measures].[Alert Count]} on 0,
[STORE].[STORE].[STORE].members on 1
from [test]
where {[CALENDAR].[Date].&[2011-05-21T00:00:00],[CALENDAR].[Date].&[2011-06-12T00:00:00]}
预期工作如下:test6 始终为 2。
select {[Measures].[test6],[measures].[Alert Count]} on 0,
[STORE].[STORE].[STORE].members on 1
from [test]
where {[CALENDAR].[Date].&[2011-05-21T00:00:00]}
[measures].[Alert Count] is a real measure (based on a column in the fact table).
CREATE MEMBER CURRENTCUBE.[Measures].[test6] as [measures].[Alert Count];
([Store].[Store].[Store].members*[Calendar].[Date].[Date].members ,[measures].[test6]) = 2;
Since the last scope assignment overwrite the measure of test6 to 2, so I expect the following to return 4 for every cell of test because we sliced with 2 dates, and each day has a test6 as 2, then rollup to get 2+2=4. But the actual result is not: test6 is always equal to [alert count].
select {[Measures].[test6],[measures].[Alert Count]} on 0,
[STORE].[STORE].[STORE].members on 1
from [test]
where {[CALENDAR].[Date].&[2011-05-21T00:00:00],[CALENDAR].[Date].&[2011-06-12T00:00:00]}
The following works expected: test6 is always 2.
select {[Measures].[test6],[measures].[Alert Count]} on 0,
[STORE].[STORE].[STORE].members on 1
from [test]
where {[CALENDAR].[Date].&[2011-05-21T00:00:00]}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果添加新成员怎么办?
有什么用吗?
What if you add a new member?
is it useful?