Tuesday, November 3, 2015

MDX Siblings Function



In Multidimensional Expression, Siblings function will return all the Child members that belongs to the parent of a specified member OR We can simply say, Siblings function will return all the Siblings of a specified member. For example, If you know single customer name and if you want to find the Sales of all the customers present in that group then you can use this Siblings function.

MDX Siblings Function Syntax

The basic syntax of the MDX Siblings is:
Member_Expression: Any Multidimensional Expression that returns valid Member.
In this article we will show you, How to write Siblings function  in MDX query with examples. For this, We are going to use the below show data
Following screenshot shows the Countries inside the Geography
 MDX SIBLINGS FUNCTION
Following screenshot shows the [State – Provinces] inside the France Country
MDX SIBLINGS FUNCTION

MDX Siblings Function Example

In this example we are going to use Siblings function to find the siblings of a France Country.
CODE
OUTPUT
MDX SIBLINGS FUNCTION 1
Analysis:
In the above MDX Query, We used [Reseller Sales amount] on the columns
Below line of code will check for the France parent (Which is All member) and then displays all the child member of the Country.

MDX Siblings Function Example 2

If we know the Loiret is one of the state in France and our intention is to find the remaining states present in France then, we can use this Siblings function. In this example we are going to find all the Child Members present in the State Province list and calculate the Reseller Sales Amount of that.
CODE
OUTPUT
MDX SIBLINGS FUNCTION  2

MDX Siblings Function Alternative

In this example we are going to use the Siblings function alternative to achieve the same result. Please refer MDX Parent Function to understand the Parent function and refer MDX Children function to understand the Children function.
CODE
OUTPUT
MDX SIBLINGS FUNCTION 3
Analysis:
In the above MDX Query, We used [Reseller Sales amount] on the columns
From Below line of code,
MDX will first implement the Parent function to find the parent member of a [Loiret], Which is France.
Next, It will implement Children function to find all the Child member belongs to the France Country.
Thank you for Visiting Our Blog