嵌套顶部的MDX查询

时间:2012-11-14 21:22:06

标签: mdx

帮助mdx查询plz(Essbase 11.1.1) 我有3个维度

[YEAR]
[SF]
[OPR_KIND]

所有

的1级层次结构
Measure: [Accounts].[FCT_OPR_SUM]

我必须找到: 前2年,每年3个顶级SF,每个SF 1个顶级OPR_KIND

对于1个嵌套顶部我做:

WITH
SET top2Year as 'TopCount( [YEAR].Generations(2).MEMBERS,2)'
SELECT {[Accounts].[FCT_OPR_SUM]} ON COLUMNS, 
NON EMPTY 
{
generate(top2Year,
crossjoin( top2Year,topcount( [SF].Generations(2).MEMBERS,3)
)
)
} 
ON ROWS
FROM cube1f.cube1f

如何处理2个或更多嵌套顶部?

1 个答案:

答案 0 :(得分:0)

你可以用接近这个的东西来做到这一点:

Generate(TopCount([YEAR].Generations(2).MEMBERS, 2, [Accounts].[FCT_OPR_SUM]), 
   {[YEAR].CurrentMember} * Generate(TopCount([SF].Generations(2).MEMBERS, 3, [Accounts].[FCT_OPR_SUM]), 
           {[SF].CurrentMember} * TopCount('your OPR_KIND set', 1, [Accounts].[FCT_OPR_SUM])
   )
)