Search code examples
ssasmdx

MDX - CHILDREN doesn't return any values, MEMBERS do


I used the following expression in MDX:

SELECT
null ON 0,
[dim].[hier].CHILDREN ON 1
FROM [Cube]

It did not return any values. However, when I issued

SELECT
null ON 0,
[dim].[hier].[hier].MEMBERS ON 1
FROM [Cube]

It worked. What is interesting, yesterday first query was working too, so I suspect some cube change might've caused that, however I don`t have an access so I cannot check it.

Is there some subtle difference between CHILDREN and MEMBERS which causes that bahaviour? I thought the two are similar except for the fact that CHILDREN digs one level down.


Solution

  • Not sure about the exact semantic of CHILDREN in case you apply it to a non-member; i.e., not sure it is implemented as MEMBERS. But to reply to this sentence :

    CHILDREN digs one level down

    no; children returns the children of the member it is applied to. Those children does not necessarily belong to the next level down. In case of a ragged hierarchy, the children could be several levels down.