Export (0) Print
Expand All

TopSum

SQL Server 2000

TopSum

Sorts a set and returns the topmost elements whose cumulative total is at least a specified value.

Syntax

TopSum(«Set», «Value», «Numeric Expression»)

Remarks

This function sorts on «Numeric Expression» and picks up the top n (the smallest number possible) elements such that their sum is at least «Value».

Important  Like the BottomSum function, this function always breaks the hierarchy.

Example
Topsum(Products.[Product Description].Members, 100000, Quantity)
 

See Also

BottomSum

Show:
© 2014 Microsoft