Sunday, November 1, 2015

MDX Children Function

In Multidimensional Expression, 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 customer is looking for iPod in Amazon.com. As a developer it is your duty to 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 Children function by writing something like [Product].[Apple].[iPod].Parent.Children. In this article we will show you, How to write Children function with examples.

MDX Children Function Syntax

The basic syntax of the MDX Children is:

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 the all the states present in the France.


CODE


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


OUTPUT





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


MDX Children Function Example 2

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


CODE


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


OUTPUT