我执行此查询并给出了此错误:
检测到无限递归:依赖循环是:直接报告 - >直接报告。
有人能帮助我吗?
WITH
MEMBER [Measures].[Direct Reporting] AS COUNT([Employee].[Employees].Members, EXCLUDEEMPTY)
SELECT
{[Measures].[Direct Reporting]} ON COLUMNS,
{[Geography].[Country].AllMembers} ON ROWS
FROM [Adventure Works]
答案 0 :(得分:0)
您选择了一种特殊类型的层次结构:父/子层次结构。
以下是针对advWks cube的计数示例:
WITH
MEMBER [Measures].[aCount] AS
Sum
(
(
[Customer].[Customer].[Customer]
,[Customer].[Customer Geography].CurrentMember
)
,IIF
(
[Measures].[Internet Order Quantity] > 50
,1
,0
)
)
SELECT
{
[Measures].[Direct Reporting]
,[Measures].[Internet Order Count]
} ON COLUMNS
,{[Customer].[Customer Geography].[Country].MEMBERS} ON ROWS
FROM [Adventure Works];
答案 1 :(得分:0)
使用EXCLUDEEMPTY指定Count表示引擎需要评估维度的每个成员和当前[Measures]引用的多维数据集的单元格。不是100%肯定SSAS行为,但似乎当前[Measures]是calc。衡量是自己定义的:因此是无限循环。
要修复它,您可以明确定义[Measures]:
WITH MEMBER [Measures]。[直接报告] AS COUNT({[Measures]。[use-here-your-measure]} * [Employee]。[Employees] .Members,EXCLUDEEMPTY)
或者也许使用NonEmpty函数:
AS Count(NonEmpty([Employee]。[Employees] .Members, [措施]。[use-here-your-measure]))
希望有所帮助。