mdx多个维度查询疑问

xiaowen_ly 2015-03-06 07:18:04

with set [custom{3D617870D704BFF0D2CC2ED4673CA5D2}] as
nonempty([Cause].[CauseName].children,axis(0))
member [Measures].[MemberCount] as
iif([Cause].[CauseName].currentmember is [Cause].[CauseName].[All],
count([custom{3D617870D704BFF0D2CC2ED4673CA5D2}]),null)
select {{[Measures].[Metric1]},
[Measures].[MemberCount]} on 0,
{[Cause].[CauseName].[All],
subset(topcount([custom{3D617870D704BFF0D2CC2ED4673CA5D2}],10,[Measures].[Metric1]),
0,10)} on 1
from ( select {[Cause].[CauseName].children} on 0 from
( select {[Time].[Date].[2014-12-30]:[Time].[Date].[2015-02-19]} on 0 from DB) )


现在想在查询最终结果中添加[Cause].[CauseKey]这一维度,该怎么写呢?

...全文
309 点赞 收藏 2
写回复
2 条回复
liao19890923 2015年03月19日
如果仅仅是要添加另外一个维度的话,那你可以用CROSSJOIN把在1轴上的所有维度交叉连接起来,当然用CROSSJOIN是会影响到一定的performance问题的 with set [custom{3D617870D704BFF0D2CC2ED4673CA5D2}] as nonempty([Cause].[CauseName].children,axis(0)) member [Measures].[MemberCount] as iif([Cause].[CauseName].currentmember is [Cause].[CauseName].[All], count([custom{3D617870D704BFF0D2CC2ED4673CA5D2}]),null) select {{[Measures].[Metric1]}, [Measures].[MemberCount]} on 0, {[Cause].[CauseName].[All]* subset(topcount([custom{3D617870D704BFF0D2CC2ED4673CA5D2}],10,[Measures].[Metric1]), 0,10)*[Cause].[CauseKey].[All]} on 1 from ( select {[Cause].[CauseName].children} on 0 from ( select {[Time].[Date].[2014-12-30]:[Time].[Date].[2015-02-19]} on 0 from DB) )
回复 点赞
xiaowen_ly 2015年03月09日
自己顶一下...
回复 点赞
发动态
发帖子
community_281
创建于2021-05-27

24

社区成员

25.9w+

社区内容

社区公告
暂无公告