How to use GetEfficientPeriodsToDateSet

已答覆 How to use GetEfficientPeriodsToDateSet

  • Wednesday, January 30, 2013 2:08 AM
     
      Has Code

    I am new to MDX wanted to know how to give the start time to this stored proc in my mdx, it looks like all it takes is a level in Hiararchy. I dont want to aggregate everything but only start aggregating from a certain time period.  This example is good, but its summing up everything from the beginning of the time till the end of the time period sepecified. I want to be able to specify the beginning time too. How can I do that.

    I dont know if I need to filter out the records that come before my beginning time period or how. Say I want the record set from 2/16/11 till 5/5/2012. How can I make the below MDX work from the specified time period.

    Thanks much

    with member [y] as CSTR([D Date].[YEAR].CurrentMember.Name)
    member [m] as CSTR([D Date].[month no].CurrentMember.Name)
    member [d] as CSTR([D Date].[day].CurrentMember.Name)
    select {[Measures].[Normal],[y],[m],[d]} on 0,
    ASSP.GetEfficientPeriodsToDateSet("(All)",[D Date].[Hierarchy].[YEAR].[2012].[5].[8]) on 1
    from [TC Cube]

All Replies

  • Monday, February 04, 2013 10:13 PM
     
     Answered

    Generally speaking, if you want to filter out criteria, you would add this criteria to the where clause or by using comma separation.  I don't see a where clause in your example.

    For example:

    select {[Measures].[MyMeasure]} on 0,

    {[Location].[Region].[City]} on 1

    from [My Cube]

    Where([D Date].[Hierarchy].[Short Date].&[2/16/11]],[Item].[SKU].&[12345])

    You can also define filtering when defining the MEMBER.

    For Example:

    Select {(Measures].[MyMeasures],[D Date].[Hierarchy].[Short Date].&[2/16/11])}

    from [My Cube]

    Where([Item].[SKU].&[12345])

  • Monday, February 11, 2013 6:40 PM
     
     

    Thanks much for your help on this, got it figured out.

    -Sarah