TOPCOUNT
Description:
This function is used to sort a set in descending order and returns the specified number of elements with the highest values.
Syntax:
TopCount(Set_Expression,Count [ ,Numeric_Expression ] )
Return type:
SET
Parameters:
Parameter | Description |
|---|---|
Set_Expression | It is a valid MDX expression that returns a set. |
Count | It is a valid numeric expression that specifies the number of tuples to be returned. |
Numeric_Expression | It is a valid numeric expression, typically an MDX expression of cell coordinates that returns a number. |
Example:
WITH MEMBER [Measures].[Top 10 Sales] AS
SUM(TopCount([Product].[Product].[Product].Members, 10, [Measures].[Internet Sales Amount]),
[Measures].[Internet Sales Amount])
SELECT {[Measures].[Internet Sales Amount], [Measures].[Top 10 Sales]} ON COLUMNS
FROM [AdventureWorksMF_ValueBased]