locked
Filtering current year and month RRS feed

  • Question

  • Hi there!

    I'm trying to filter current year and month form my SSAS - Dataset.
    I've tried year(now()) and month(now)) as function in the value field of my filter, which won't work.
    The message that comes up in my diagrams is: No data available (it is originally written in german - I hope my translation is OK).
    Writing the Year as 2009 and the month as 10 in the same field (value) - everything's just fine.

    I'm new to MDX and maybe the problem is because of that.

    Thanks for your help!

    Markus
     
    Saturday, October 10, 2009 7:22 PM

Answers

  • Please post the query u r using..
     at the same time check whether u r following the below method

     Assuming u have  member  in year level is  [Date].[Year].[2009]
    U can pass u r mdx code based on u r system date
    STRTOMEMBER
    ("[Date].[Year].[+ Year(NOW()))+"]")

    i mean to say that u cant just pass the member by writing  year(now()) and month(now))
    the members have to passed to u r query in such way that u r dimension are built

    see my second case

    year level is  [Date].[Year].[Year2009]
    U can pass u r mdx code based on u r system date
    STRTOMEMBER
    ("Date].[Year].[+ "Year"+cstr(Year(NOW())))+"]")


    Please find the diffrence

    Praxy
    Monday, October 12, 2009 12:21 PM

All replies

  • Hello Markus,

    at all it's not an error message.
    So I guess there is something wrong with your query.


    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Saturday, October 10, 2009 11:44 PM
  • Hi Olaf!

    * Wenn ich denke, ist das ein Fehler und das beweise ich täglich *  I like that :-).

    I'm with you. But what could be wrong with year(now()), and month(now()) using as function within a filter.
    I'm searching a debbuging function to see the return values of these functions, but couldn't find it.

    I'll go on searching...

    Markus
    Monday, October 12, 2009 8:27 AM
  • Try getting the data output from sql and bind it in the report if that is your real requirement.
    Regards, KarthikShanth.
    Monday, October 12, 2009 10:36 AM
  • Hello Markus,

    you can use also the "profiler" (in SSMS => menu "Extras" => SQL Server profiler") to trace the mdx statements are send to the cube.
    Then you can test and analyse statements in SSMS.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Monday, October 12, 2009 11:44 AM
  • Please post the query u r using..
     at the same time check whether u r following the below method

     Assuming u have  member  in year level is  [Date].[Year].[2009]
    U can pass u r mdx code based on u r system date
    STRTOMEMBER
    ("[Date].[Year].[+ Year(NOW()))+"]")

    i mean to say that u cant just pass the member by writing  year(now()) and month(now))
    the members have to passed to u r query in such way that u r dimension are built

    see my second case

    year level is  [Date].[Year].[Year2009]
    U can pass u r mdx code based on u r system date
    STRTOMEMBER
    ("Date].[Year].[+ "Year"+cstr(Year(NOW())))+"]")


    Please find the diffrence

    Praxy
    Monday, October 12, 2009 12:21 PM