在MDX语句中使用.CHILDREN和.ALLMEMBERS时结果的差异 [英] Difference in results while using .CHILDREN and .ALLMEMBERS in an MDX statement
问题描述
我有两个几乎相似的MDX查询,一个是我使用.CHILDREN,另一个是.ALLMEMBERS.第一个不返回任何行,第二个不返回两个行.请帮助我理解原因!
I have two almost similar MDX queries, in one I am using .CHILDREN and in other .ALLMEMBERS. First one returns no rows, the second one returns two. Please help me in understanding why!
查询1
select
[Measures].[Claim As Of - Count] on 0,
[Accident Date].[Year].allmembers on 1
from [AW Cube]
where [Accident Date].[Year-Quarter-Month-Date].[Year].&[2010]
--- 2行
查询2
select
[Measures].[Claim As Of - Count] on 0,
[Accident Date].[Year].children on 1
from [AW Cube]
where [Accident Date].[Year-Quarter-Month-Date].[Year].&[2010]
-没有行
----索赔截至-计数 -全部637,350 --2010 637,350
---- Claim As Of - Count --All 637,350 --2010 637,350
加起来, AccidentDate是我的多维数据集[AW Cube]中的维度之一.年是自然层次结构,而[年-季度-月-日期]是用户定义的层次结构. [Year-Quarter-Month-Date]是通过以下方式创建的:Year-> Month ---> Quarter ---> Date.因此,可以通过[Accident Date].[Year-Quarter-Mon-Date].[Year] .members and [Accident Date].[Year] .MEMBERS.
Just to add up, AccidentDate is one of the Dimensions in my Cube [AW Cube]. Year is a natural hierarchy while [Year-Quarter-Month-Date] is an user defined hierarchy. [Year-Quarter-Month-Date] is created in the below way: Year-->Month--->Quarter--->Date. So 'years' can be obtained by doing [Accident Date].[Year-Quarter-Month-Date].[Year].members and also [Accident Date].[Year].MEMBERS.
推荐答案
好吧,我自己得到了答案.实际上,每个.CHILDREN
都在内部转换为.CURRENTMEMBER.CHILDREN
.现在,[Accident Date].[Year].&[2010]
是用户定义的层次结构上切片器的对应值.在这里,[Accident Date].[Year].CHILDREN
实际上被转换为[Accident Date].[Year].&[2010].CHILDREN
,这基本上是一个空集.因此,瞧!空结果集!
Well, got the answer myself. Actually every .CHILDREN
gets internally translated to .CURRENTMEMBER.CHILDREN
Now, [Accident Date].[Year].&[2010]
is the corresponding value for the slicer on user defined hierarchy. Here, [Accident Date].[Year].CHILDREN
actually gets translated to [Accident Date].[Year].&[2010].CHILDREN
which is basically an empty set. Hence, Voila! The empty result set!
这篇关于在MDX语句中使用.CHILDREN和.ALLMEMBERS时结果的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!