我有一个
的立方体[Measures].[Value]
(整数)和[Measures].[EffectiveBelowLevel]
(整数)。[ParentChildHierarchy]
的参差不齐的用户层次结构。我想基于([Measures].[EffectiveValue])
在度量维[Measures].[Value]
上创建一个计算成员,当[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].
是否可以通过度量维度上的计算成员实现此功能?
如果是,那么公式会是什么样的?
如果没有,那么会有什么其他方式? 我对任何其他类型的解决方案也很感兴趣(例如mdx查询等)
举个例子:
[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
使用此数据[Measures]。[EffectiveValue]应如下所示
ParentChild EffectiveValue Parent 0 Child 10 GrandChild1 10 GrandChild2 20
答案 0 :(得分:0)
行情如何(我不确定等级序数是否为0):
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 [...]
您可以查看此MDX文档here以获取更多详细信息。
答案 1 :(得分:0)
我看到你也在这里发布了这个问题(原来是在ssas msdn论坛上看到的),所以我提供了我的答案的链接,因为它可能会帮助其他人。 thread link on SSAS msdn forum
@Marc - 由于这是父子维度和p / c维度可以在非叶子成员上关联数据的情况,因此查询不会返回正确的结果。我花了一些时间来弄清楚如何在这种情况下汇总儿童的正确结果,并建议您查看链接。 Offtopic:祝你的产品好运,我希望有一天我会抽出时间来评价它:)
此致 赫尔沃耶