topSum

Sorts the set specified in "set_expression" in descending order and returns the topmost elements from the sorted set whose cumulative total is greater than or equal to "value".

Syntax

topSum ( set_expression , value , numeric_expression2 )

Example

topSum ( children ( [Products] ) , 16000000 , tuple ( [2006] ,
 [great_outdoors_company].[Measures].[Gross profit] ) )

Result

For the Product line members, returns the members with the largest Gross profit whose total for the year 2006 is at least $6,000,000.