我正在使用分析服务 2010。在我使用的多维数据集中,我有一个包含客户详细信息的层次结构。我做了一个函数来根据他们的内容计算来自所有国家的成员,即欧洲、南美和北美。然后,我使用以下目标表达式制作了一个 KPI:
价值表达:
[Measures].[ Profit]
目标表达
Case
When [Customer].[Customers]
Is [Customer].[Customers].[Country].&[Europe]
Then .25
When [Customer].[Customers]
Is [Customer].[Customers].[Country].&[NorthAmerica]
Then .20
When [Customer].[Customers]
Is [Customer].[Customers].[Country].&[SouthAmerica]
Then .15
Else .10
End
状态表达式:
Case
When KpiValue("MarginProfitCountries") /
KpiGoal("MarginProfitCountries") > .60
Then 1
When KpiValue("MarginProfitCountries") /
KpiGoal("MarginProfitCountries") <= .60
And
KpiValue("MarginProfitCountries") /
KpiGoal("MarginProfitCountries") > .40
Then 0
Else -1
END
趋势表达:
Case
When IsEmpty(ParallelPeriod([Time].[CalendarSales].[CalendarYear],
1, [Time].[CalendarSales]))
Then 0
When [Measures].[ Profit] >
(ParallelPeriod([Time].[CalendarSales].[CalendarYear],
1,[Time].[CalendarSales]), [Measures].[ Profit])
Then 1
When [Measures].[ Profit] =
(ParallelPeriod([Time].[CalendarSales].[CalendarYear],
1,[Time].[CalendarSales]), [Measures].[ Profit])
Then 0
Else -1
End
尝试设定目标以匹配特定标准。但是,每当我尝试处理 KPI 时,都会收到以下错误:
遇到不能包含计算成员的集合
有什么方法可以将计算的成员作为单个成员处理?
编辑:
计算脚本
CREATE MEMBER CURRENTCUBE.[Customer].[Customers].[All Customers].[Europe]
AS [Customer].[Customers].[Country].&[Austria] + [Customer].[Customers].[Country].&[Denmark] + [Customer].[Customers].[Country].&[Finland] + [Customer].[Customers].[Country].&[France] +
[Customer].[Customers].[Country].&[Germany] + [Customer].[Customers].[Country].&[Ireland] + [Customer].[Customers].[Country].&[Italy] + [Customer].[Customers].[Country].&[Norway] +
[Customer].[Customers].[Country].&[Poland] + [Customer].[Customers].[Country].&[Portugal] + [Customer].[Customers].[Country].&[Spain] + [Customer].[Customers].[Country].&[Sweden] +
[Customer].[Customers].[Country].&[Switzerland] + [Customer].[Customers].[Country].&[UK],
VISIBLE = 1;
CREATE MEMBER CURRENTCUBE.[Customer].[Customers].[All Customers].[NorthAmerica]
AS [Customer].[Customers].[Country].&[Canada] + [Customer].[Customers].[Country].&[USA] + [Customer].[Customers].[Country].&[Mexico],
VISIBLE = 1;
CREATE MEMBER CURRENTCUBE.[Customer].[Customers].[All Customers].[SouthAmerica]
AS [Customer].[Customers].[Country].&[Argentina] + [Customer].[Customers].[Country].&[Brazil] + [Customer].[Customers].[Country].&[Venezuela],
VISIBLE = 1;