SQL Server Performance

MDX: Question best approach to query

Discussion in 'Analysis Services/Data Warehousing' started by BigJimSlade, Aug 31, 2005.

  1. BigJimSlade New Member

    I need to create a calculated measure that sums all of the activity(minutes)
    in my cube from the first date in the ActivityDate dimension until a given
    time for example


    I'm using the following MDX :
    SUM(PeriodsToDate([ActivityDate].[Std].[(All)] ,[ActivityDate].[Std].[Year
    Number].[2001].&[24008].&[20010816]),[Measures].[Activity Minutes])

    The problem is that I need to replace the hardcoded [ActivityDate].[Std].[Year
    Number].[2001].&[24008].&[20010816] with the value
    of a member property in the term dimension

    I can almost do this using this mdx expression:

    I'm having trouble putting the two pieces together I need to somehow convert
    a string to the coresponding member in the ActivityDate Dimension

    There seems like there must be a more elagant solution

    Any ideas?
  2. Raulie New Member

    To bring back an integer use VAL.


    The VAL VB Function will return the number value of a string.


Share This Page