MDX Children Function

How to write Children function with examples?. The MDX Children function will return the associate Child member that belongs to the specified member. 

For instance, If you are an Amazon developer and If one of your customers is looking for iPod in Amazon.com. As a developer, you must display all the Apple products at the bottom of the page. So that user can browse other products and sometimes he may buy? In these situations, you can use the MDX Children function by writing something like [Product].[Apple].[iPod].Parent.Children.

MDX Children Function Syntax

The basic syntax of the Children Function in Multidimensional Expression is as shown below:

Member_Expression.CHILDREN

Member_Expression: Any Multidimensional Expression that returns valid Member.

MDX Children Function Example

In this example, we are going to find the [Reseller Sales amount] of all the states present in France.

SELECT 
  [Measures].[Reseller Sales Amount] ON COLUMNS,
  [Geography].[Geography].[Country].[France].CHILDREN ON ROWS
FROM [Adventure Works];
MDX CHILDREN FUNCTION 1

From the above MDX screenshot, you can observe that It is displaying all the states present in France.

Children Function Example 2

In this example, we are going to find the [Reseller Sales amount] of all the countries present in the Geography attribute.

SELECT 
  [Measures].[Reseller Sales Amount] ON COLUMNS,
  [Geography].[Geography].CHILDREN ON ROWS
FROM [Adventure Works];
MDX CHILDREN FUNCTION
Categories MDX