How can I select Current Month as default Value from Date Dimensions?

  • Hi

     

    I need to display current month value as my default Value for (OLAP) Reporting services Reports Parameters, How can I select Current Month as default Value from Date Dimensions?

    Ex:

    Oct 2004=       [Date].[All Date].[2004].[October]

    Nov 2004=      [Date].[All Date].[2004].[November]

     

     

    Thanks in advance

    Regards & Thanks

    Vijay Vijayaratnam

  • This was removed by the editor as SPAM

  • A simple way to do this could be to add a sorting column to your query that populates the combo, and then return the values for the combo in the order in which you want them displayed.

    Steve.

  • Hi Steve

    Thanks Again

    Thanks for your reply.Thank you for your time.

    Regards & Thanks

     Vijay

     

  • We have done the same thing at our place. Here’s how we do it, in the time dimension click the edit button in property “default measure” in the option “Enter MDX formula…..” paste the following - StrToMember("[Time].[Month].[" + Format(Now(), "mmmm ") + "]") and click ok.

    Now I know not all time dimensions are built the same way, in fact at one place I had to use the following - StrToMember("[Month].[Year].&[" + Format(Now(), "yyyy") + "].&["+ Format(Now(), "mmm") + "]")

    So for October 2004 the resulting MDX value looked like this -

    StrToMember("[Time].[Month].[" + Format(Now(), "mmmm ") + "]") = [Time].[Month].[October]

    StrToMember("[Month].[Year].&[" + Format(Now(), "yyyy") + "].&["+ Format(Now(), "mmm") + "]") = [Month].[Year].&[2004].&[10]

    If the MDX doesn’t match your dimension it shouldn’t take long to figure the syntax.

    So in your case you may need to use -

    StrToMember("[Date].[ All Date].&[" + Format(Now(), "yyyy") + "].&["+ Format(Now(), "mmmm") + "]") = [Date].[All Date].& [2004].& [October]

    Hope this helps.

    Howard.

  • Hi Howard

    Excellent Advice Howard

    Thanks for your reply.Thank you for your time.

    Regards & Thanks

     Vijay

  • I've been playing around for a better way and come up with this.

    Tail(Filter([Time].[Month].Members, NOT IsEmpty(Time.CurrentMember)),1).Item(0)

    It should be quicker as there's not converting strings to members

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply