我正在使用分析服务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;