Search code examples
ssasmdx

What measure is this script using when no measure is specified


Ok, so im trying to look at examples on how to use this function, but I still dont get it. The example on msdn, here https://msdn.microsoft.com/en-us/library/ms145500.aspx?f=255&MSPPError=-2147217396

Using AW 2008 as an example, this query

       SELECT ParallelPeriod ([Date].[Calendar].[Calendar Semester]
       , 3
       , [Date].[Calendar].[Month].[October 2007])
       ON 0

   FROM [Adventure Works]


results:
April 2006
$882,899.94

Where is that value coming from? What measure is this pulling from?

Now, this other example looks a bit more clear. http://www.databasejournal.com/features/mssql/article.php/10894_3073581_3/MDX-Essentials---MDX-Time-Series-Functions-Part-III-The-LastPeriods-and-ParallelPeriod-Functions.htm


Solution

  • That will be the default measure for the cube, or more precisely the default member for the Measures dimension.

    Try this query to see what I mean:

    WITH MEMBER [Measures].[Default Measure] AS
    [Measures].DefaultMember.Name
    SELECT
    [Measures].[Default Measure] On 0
    FROM [Adventure Works]
    

    This returns "Reseller Sales Amount" for my version.

    Hope that helps,

    Ash