Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
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:
© 2015 Microsoft