First, the Product Named Set can be created by applying appropriate
dimension context in the Filter():
Quote:
|
With Set [ProductSubset] as
|
'Filter([Product Family].[All Product Family].children,
([Measures].[Cust Ret Last Week],
[VMI].[All VMI].[valid],
[Source Code].[All Source Code].[valid],
[Attributed Class].[All Attributed Class].[US],
[Drive Diagnosis Code].[All Drive Diagnosis Code].[valid])
The problem with [top 10 final g codes] may be that Named Sets are not
dynamically re-evaluated, so instead all the cross-joined combinations
can be computed and saved:
Quote:
|
set [top 10 final g codes] as
|
'Generate([ProductSubset],
topcount(CrossJoin({[Product Family].CurrentMember},
[Attributed Class].[All Attributed Class].[US].children),
10, [Measures].[Cust Ret Last Week])'
member [Measures].[xrank] as
'Rank(([Product Family].CurrentMember,
[Attributed Class].CurrentMember),
[top 10 final g codes]) - (10 *
Int((Rank(([Product Family].CurrentMember,
[Attributed Class].CurrentMember),
[top 10 final g codes])-1) / 10))'
select
{[Measures].[Cust Ret Last Week], [Measures].[xrank]} on columns,
[top 10 final g codes] on rows
from
[MyCube]
where
([Drive Diagnosis Code].[All Drive Diagnosis Code].[valid],
[VMI].[All VMI].[valid],
[Source Code].[All Source Code].[valid])
- Deepak
Deepak Puri
Microsoft MVP - SQL Server
*** Sent via Developersdex http://www.developersdex.com ***