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

Getting values on the last date with data

In this recipe we're going to learn how to get the value of a measure on the last date with data. If you haven't read the previous recipe, do it before reading this one as this recipe continues where the previous recipe had stopped.

Getting ready

Start SQL Server Management Studio and connect to your SSAS 2008 R2 instance. Click on the New Query button and check that the target database is Adventure Works DW 2008R2.

In this example we're going to use the simplified version of the query from the previous chapter, simplified in a sense that it has only one measure, the time-sensitive measure:

WITH MEMBER [Measures].[Last existing date] AS Max( EXISTING [Date].[Date].[Date].MEMBERS, iif( [Measures].[Internet ...

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