我们将在层次上探索 TOP-filters 的通用选项实现。
可以为每个级别设置 TOP 规则。
它用于详细分析数据(展开、向下钻取)。
聚合是基于 TOP 形成的。
只要数据在最数据透视表中排序,设置排序顺序就可以了。
SELECT
{ [Measures].[Reseller Sales Amount] }
DIMENSION PROPERTIES PARENT_UNIQUE_NAME , HIERARCHY_UNIQUE_NAME , CUSTOM_ROLLUP , UNARY_OPERATOR , KEY0 ON 0
, ORDER
( HIERARCHIZE
( HIERARCHIZE ( [Geography].[Geography].Levels ( 0 ).Members )
)
, ([Measures].[Reseller Sales Amount])
, BDESC
)
DIMENSION PROPERTIES PARENT_UNIQUE_NAME , HIERARCHY_UNIQUE_NAME , CUSTOM_ROLLUP , UNARY_OPERATOR , KEY0 ON 1
FROM
( SELECT
{ Generate
( [Geography].[Geography].Levels ( 3 ).Members
, TopCount
( Filter
( [Geography].[Geography].CurrentMember.Children
, NOT IsEmpty ( [Measures].[Reseller Sales Amount] )
)
, 3
, [Measures].[Reseller Sales Amount]
)
)
} ON COLUMNS
FROM
( SELECT
{ Generate
( [Geography].[Geography].Levels ( 2 ).Members
, TopCount
( Filter
( [Geography].[Geography].CurrentMember.Children
, NOT IsEmpty ( [Measures].[Reseller Sales Amount] )
)
, 3
, [Measures].[Reseller Sales Amount]
)
)
} ON COLUMNS
FROM
( SELECT
{ Generate
( [Geography].[Geography].Levels ( 1 ).Members
, TopCount
( Filter
( [Geography].[Geography].CurrentMember.Children
, NOT IsEmpty ( [Measures].[Reseller Sales Amount] )
)
, 3
, [Measures].[Reseller Sales Amount]
)
)
} ON COLUMNS
FROM
( SELECT
{ Generate
( [Geography].[Geography].Levels ( 0 ).Members
, TopCount
( Filter
( [Geography].[Geography].CurrentMember.Children
, NOT IsEmpty ( [Measures].[Reseller Sales Amount] )
)
, 3
, [Measures].[Reseller Sales Amount]
)
)
} ON COLUMNS
FROM
( SELECT
{ [Geography].[Geography].Levels ( 0 ).Members } ON COLUMNS
FROM [Adventure Works]
)
)
)
)
)
CELL PROPERTIES BACK_COLOR , CELL_ORDINAL , FORE_COLOR , FONT_NAME , FONT_SIZE , FONT_FLAGS , FORMAT_STRING , VALUE , FORMATTED_VALUE , UPDATEABLE , ACTION_TYPE