When a cube is deployed and browsed, I wish to see only an immediate manager of an employee.
The cube result shows all managers of a paticular employee, like below:
Abbas, Sanchez, 825
Abbas, Welcker, 825
Abbas, Abbas, 825`
I want to see only the immediate manager of a paticular employee, meaning this:
Abbas, Welcker, 825
DimEmployee dimention has the following attributes: EmployeeKey, LastName, ParentEmployeeKey.
Deploy cube and browse. Drag the following attributes: LastName, ParentEmployeeKey, Order Quantity. SCREENSHOT 2
Maybe you could try either of these mdx
functions:
.Parent
... https://msdn.microsoft.com/en-us/library/ms145513.aspx
ancestor
... https://msdn.microsoft.com/en-us/library/ms145616.aspx
The context of the query in which you are trying to get the parent is important. What I mean is depending on what else you require on rows and columns or in the slicer will impact the way you use mdx
to find the parent.
Something like the following may work:
WITH MEMBER Measures.ParentKey AS
[Dim Employee].[Parent Employee Key].CurrentMember.Parent.member_caption
SELECT
{[Measures].ParentKey } ON 0,
[Dim Employee].[Parent Employee Key].[(All)].members ON 1
FROM [YourCube]