Ssas 如何基于两个度量值和查询维度的层次结构级别创建计算成员';谁是现任会员?

Ssas 如何基于两个度量值和查询维度的层次结构级别创建计算成员';谁是现任会员?,ssas,mdx,olap-cube,Ssas,Mdx,Olap Cube,我有一个立方体 两个度量值成员:[Measures].[Value](整数)和[Measures].[EffectiveBelowLevel](整数) 名为[DimParentChild]的维度,其用户层次结构不规则,称为[ParentChildHierarchy] 我想基于[measures].[Value]在度量维度([measures].[EffectiveValue])上创建一个计算成员,当沿着[DimParentChild]和[ParentChildHierarchy]进行查询时,

我有一个立方体

  • 两个度量值成员:
    [Measures].[Value]
    (整数)和
    [Measures].[EffectiveBelowLevel]
    (整数)
  • 名为[DimParentChild]的维度,其用户层次结构不规则,称为
    [ParentChildHierarchy]
我想基于
[measures].[Value]
在度量维度
([measures].[EffectiveValue])
上创建一个计算成员,当沿着
[DimParentChild]
[ParentChildHierarchy]
进行查询时,其行为如下:

- [Measures].[Value] is used if the hierarchy level of [DimParentChild].[ParentChildHierarchy].CURRENTMEMBER > [Measures].[EffectiveBelowLevel].
 - 0 is used if the hierarchy level of [DimParentChild].[ParentChildHierarchy].CURRENTMEMBER <= [Measures].[EffectiveBelowLevel].
如果[DimParentChild].[ParentChildHierarchy].CURRENTMEMBER>[Measures].[EffectiveBelowLevel]的层次结构级别为[DimParentChild].[ParentChildHierarchy],则使用
-[Measures].[Value]。

-如果[DimParentChild].[ParentChildHierarchy]的层次结构级别为0,则使用0。CURRENTMEMBER这样做怎么样(我不确定级别序号是否基于0):


您可以查看此MDX文档以了解更多详细信息。

我看到您也在此处发布了此问题(最初在ssas msdn论坛上看到),因此我提供了指向我的答案的链接,因为它可能会帮助其他人

@Marc-由于这是父子维度和p/c维度的情况,因此可以在非叶成员上关联数据,因此您的查询不会返回正确的结果。在这种情况下,我花了一些时间才弄明白如何汇总来自儿童的正确结果,并建议您查看链接。题外话:祝你的产品好运,我希望有一天我能有时间评估一下:)

问候,,
Hrvoje可以有与非叶成员相关的数据:对,我没有考虑这种可能性。谢谢你的离题;-)你好,Hrvoje,谢谢你的交叉链接!我首先在这里发布了这个问题,然后意识到social.msdn在这个主题中有更多的活动。你好,佐尔坦 [Measures] [Value] [EffectiveBelowLevel] ParentChildAssociation 10 1 GrandChild1 20 2 GrandChild2 [DimParentChild].[ParentChildHierarchy] Member HierarchyLevel Description Parent 1 - Child 2 first child of Parent GrandChild1 3 first child of Child GrandChild2 3 second child of Child ParentChild EffectiveValue Parent 0 Child 10 GrandChild1 10 GrandChild2 20
with member xx as 
  Sum( [DimParentChild].[ParentChildHierarchy].currentMember as myCurrentMember,
    Sum( Descendants( myCurrentMember(0), 64, LEAVES ), 
         IIF( myCurrentMember(0).level.ordinal > [EffectiveBelowLevel], [Value], 0 ) 
    )
  )

select [xx] on 0, [DimParentChild].[ParentChildHierarchy].members on 1 from [...]