O'Reilly logo

MDX with Microsoft SQL Server 2008 R2 Analysis Services: Cookbook by Tomislav Piasevoli

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

Calculating row numbers

Those who know the row numbers can navigate the results of the query. Those who don't can only jump to a certain position, such as the first tuple, the last tuple, and so on.

This recipe is based on the previous one. It continues using the current tuple on an axis in order to determine its position in the whole set on rows. Once we know the position, we can capture the previous or the next tuple on rows and make interesting relative calculations that work in any context.

Getting ready

Open the Business Intelligence Development Studio (BIDS) and then open the Adventure Works DW 2008 solution. Once it loads, double-click the Adventure Works cube and go to the Calculations tab. Turn on the Script View and navigate to the end ...

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