MDX-icCube-如何获得其他聚合的动态最高计数/最高百分比? [英] MDX - icCube - How to get a DYNAMIC topcount/toppercent with other aggregated?

查看:92
本文介绍了MDX-icCube-如何获得其他聚合的动态最高计数/最高百分比?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下mdx,我可以动态地检索正确的数据.

Using the following mdx, I'm able to retrieve correct data dynamically.

create CATEGORY MEMBER [Stats].[Top].[All Etabs].[Top 5 Etablissements] 
    as topcount( [Etablissement].[Etablissement].[Etablissement].allMEMBERS, 5, [Measures].[Nbsejours]),ADD_CHILDREN=true

create CATEGORY MEMBER [Stats].[Top].[All Etabs].[Autres Etablissements (>5)] 
    as Except([Etablissement].[Etablissement].[Etablissement].members,  TopCount( [Etablissement].[Etablissement].[Etablissement].MEMBERS, 5, [Measures].[Nbsejours])),ADD_CHILDREN=false

create dynamic set [Top 5 & Others] 
    as {[Stats].[Top].[Top 5 Etablissements], [Stats].[Top].[Autres Etablissements (>5)]}

Select {[Measures].[NbSejours]} on 0,
nonempty ([Top 5 & Others]) on 1
From //[Cube]
( SELECT { {[Geographique].[Zone].[All-M].&[1006]} } ON 0 FROM [Cube])

但是,topCount本身不是动态的.在此示例中,排名前5位的组合永远不会改变,只有值会改变...

But, the topCount is not dynamic itself. In this example, the top 5 etablissement never change, only the values do change...

是否可以通过动态的topCount/topPercent获得此功能? Txs, 贝特朗.

Is there a way to get this with dynamic topCount/topPercent ? Txs, Bertrand.

推荐答案

类别(*)尚未启用动态标志,因此无法定义将针对每个MDX请求针对集合一次计算一次的类别.

Categories (*) have not yet the dynamic flag so it's not possible to define a category that will be calculated for each MDX request once as it happens for a set.

因此它将更像是(请注意,我已经使用了 SubCubeComplement 很大-可能确实很多-更快)

So it's going to be something more like (note I've use the SubCubeComplement that is a lot - may be really a lot - faster )

create dynamic set [Top 5] as 
      topcount( [Etablissement].[Etablissement].[Etablissement].members, 5, [Measures].[Nbsejours])

*** End script ***

WITH 
 CATEGORY HIERARCHY [Stats].[Top], DEFAULT_MEMBER_NAME = "All Etabs"
 CATEGORY MEMBER [Stats].[Top].[All Etabs].[Top 5 Etablissements] as 
      [Top 5],ADD_CHILDREN=true
 CATEGORY MEMBER [Stats].[Top].[All Etabs].[Autres Etablissements (>5)] as
      SubCubeComplement([Top 5]),ADD_CHILDREN=false
SELECT
  {[Measures].[NbSejours]} on 0,
  { [Stats].[Top].[Top 5 Etablissements], 
    [Stats].[Top].[Autres Etablissements (>5)] } on 1
From [Cube]

(*)对于不熟悉icCube的人员,类别是一种将新"成员定义为一组成员的方式(他们可能具有不同的维度).这可以确保对于复杂的计算,具有多对多关系的架构正确地计算值.否则,确保计算正确性可能会有些噩梦.

(*) For the people that are not used to icCube, Categories is a way defining a 'new' member as a set of members (they might have different dimensionalities). This ensures for complex calculations, schemas with many-to-many relations that the values are correctly calculated. Otherwise it might be a little nightmare to ensure calculation correctness.

这篇关于MDX-icCube-如何获得其他聚合的动态最高计数/最高百分比?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆