O'Reilly logo

Microsoft® SQL Server® 2008 MDX Step by Step by C Ryan Clay Bryan C Smith and Hitachi Consulting

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving the First or Last Tuples of a Set

As mentioned in the previous section, ordering sets by a value is often used to help focus attention on the most critical data. Quite frequently, this "most critical" data is the only data of interest. Business intelligence reports and dashboards are often littered with information on top or bottom performers. In the MDX language, the limiting of sets in this manner is performed through the TopCount and BottomCount functions:

TopCount( {Set}, n [, Expression])
BottomCount( {Set}, n [, Expression])

With the TopCount function, the first of a specified number of tuples is returned from a set. If an expression is provided, the set is sorted in break-hierarchy descending order. If no expression is provided, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required