CurrentMember.Children失去了背景

时间:2017-12-07 14:35:57

标签: sql-server ssas mdx data-warehouse olap

我有一个简单的查询:

WITH
MEMBER [Condition] AS -some-logic-
SET [Items] AS FILTER([Item].[Group - Item].CurrentMember.Children, [Condition])
MEMBER [Some Metric] AS SUM([Items], [Usages])
SET [Groups] AS NonEmpty([Item].[Group - Item].[Group], [Cost])
SELECT
  [Some Metric] ON COLUMNS,
  [Groups] ON ROWS
FROM [Spend]
WHERE (FiltrationMember1, FiltrationMember2)

此查询的结果始终为null,并且看起来成员[Some Metric]无法预先计算项集。就像它失去了“.CurrentMember”的背景。这就是为什么我这么认为,例如,如果我将[Some Metric]成员更改为:

MEMBER [Some Metric] AS SUM(FILTER([Item].[Group - Item].CurrentMember.Children, [Condition]), [Usages])

它按预期开始工作:我在行上获取组,但相关值不是由整个组计算,而是由几个满足条件过滤器的项计算。

我尝试在我的设置上使用EXISTING函数,只要我在MSDN中看到它有助于强制使用当前上下文但没有运气。这真的让我觉得我不能在计算成员的第二级+上使用CurrentMember,我是对的吗?

0 个答案:

没有答案