TOPCOUNT

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

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:

SELECT {[Measures].[Internet Average Sales Amount]} ON 0, TOPCOUNT( [Product].[Product Categories].[Product].MEMBERS ,10, [Measures].[Internet Sales Amount]) ON 1 FROM [AdventureWorksMF]

Copyright Kyvos, Inc. 2026. All rights reserved.