3
votes

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!

Query 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 rows

Query 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]

--NO rows

---- Claim As Of - Count --All 637,350 --2010 637,350

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.

1
Will no knight come forth to rescue the poor soul? :(SouravA

1 Answers

5
votes

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!