return top 5.... under specifcied dimension join another
Dear all,
i'm working on this problem and see any one can give me insight:
my MDX statement is to get a top 5 data from a cube with some dimensions.. should be pretty simple .. looking like this..
Select { [Measures].[grsamount]} on columns, This working fine and returns me a result like..
non empty {topCount ([Distributors].[Distributors Groups].[Distributor Group ABC].children, 5, [Measures].[grsamount]) } on rows
from [transactions] where ([time].[all time].[2006].[q2].[jun],
[Transaction Status].[Status].[Settled], [Sales Office].[All Sales Office].[US])
Distributor A, $1
Distributor B, $2
(assume there is only 2 distributors under Distributor Group ABCAND US office)
However, i have to retrieve a dimension properties of Internal code and I'm using the WITH MEMBER to do this and put it in the columns .. as below:
WITH MEMBER [MEASURES].[Distributor_Code] as
'Distributors.CurrentMember.Properties ("Dist_InternalCode") '
Select { [Measures].[grsamount], [MEASURES].[Distributor_Code] } on
columns,
non empty {topCount ([Distributors].[All Distributors].[Distributor ABC].children, 5, [Measures].[grsamount]) } on rows
from [transactions] where ([time].[all time].[2006].[q2].[jun],
[Transaction Status].[Status].[Settled], [Sales Office].[All Sales Office].[US])
Problem is.. this time the return is as :
Distributor A, $1
Distributor B, $2
Distributor X
Distributor Y
Distributor Z
The Distributor X, Y, Z belongs to Distributor Group ABC as well butnot belongs to US office. However the result returned includes X, Y, Z distributor as well... Do any one know why and how to correct this?
Slightly urgent as the report with MDX is already in production but it's doing olap structure change and turn out to have this problem... Customer is still using OLAP 2000.. pls advice.
Regards, Andy

