如何在MDX中获取上个月的数据

时间:2018-02-02 03:32:55

标签: reporting-services mdx

我正在尝试获取上个月的SSRS报告数据。但我没有得到任何结果。请你帮忙。我的问题是。

SELECT 
  NON EMPTY 
    {[Measures].[Trade Net Amount]} ON COLUMNS
 ,NON EMPTY 
    {
        [Fund].[Fund Name].[Fund Name].ALLMEMBERS*
        [Transaction Type].[Transaction Description].[Transaction Description].ALLMEMBERS*
        [Calendar Day].[Year].[Year].ALLMEMBERS*
        [Calendar Day].[Month].[Month].ALLMEMBERS
    }
  DIMENSION PROPERTIES 
    MEMBER_CAPTION
   ,MEMBER_UNIQUE_NAME
   ON ROWS
FROM 
(
  --FROM ( SELECT ( STRTOSET(@CalendarDayMonth, CONSTRAINED) ) ON COLUMNS 
  --FROM ( SELECT ( STRTOSET(@CalendarDayYear, CONSTRAINED) ) ON COLUMNS
  SELECT 
    StrToMember
    (
          "[Calendar Day].[Calender Hierarchy].[Month].[" + Format(Now(),"yyyy")
        + 
          Format
          (
            Now()
           ,"MMM"
          )
      + "].PrevMember"
    ) ON COLUMNS
  FROM [Escher_Hybrid]
);

0 个答案:

没有答案