Following on from this question regarding calculating a member I have 2 calculated members defined as:
MEMBER [Asset].[Class].[Fixed Income Derivatives]
AS
AGGREGATE(
{
[Asset].[Class].&[Fixed Income],
[Asset].[Sub Class].&[Derivatives]
},
[Measures].CurrentMember
)
MEMBER [Asset].[Class].[Fixed Income Non-derivatives]
AS
AGGREGATE(
{
[Asset].[Class].&[Fixed Income],
EXCEPT([Asset].[Sub Class].[Sub Class],[Asset].[Sub Class].&[Derivatives])
},
[Measures].CurrentMember
)
I can use these in an MDX query as follows:
SELECT
{
[Measures].[Market Value]
} ON 0,
NON EMPTY
{
[Asset].[Class].[Fixed Income Derivatives],
[Asset].[Class].[Fixed Income Non-derivatives]
[Asset].[Class].[Class]
} ON 1
FROM [Asset]
And this gives me output as follows:
Class-----------------------|-MarketValue
============================|=============
Fixed Income Derivatives | 12345
Fixed Income Non-derivatives| 54321
Fixed Income | 66666
Property | 123
Equity | 987
Note that the first 2 rows are actually constituant parts of Row 3. Now, I can do some magic with the client code which reads this data to turn that table into a hierarchy, but - and here's the question - can I do it using MDX? Or am I just complicating things? Im not adverse to making changes in the cube if necessary, or if I could define this hierarchy there.