0

我在 Visual Studio 2005 中基于 SSAS 2008 R2 Qube 数据源构建了一个 SSRS 收入报告,用于部署在 MS SharePoint 2005 Server 上。它运行良好(俄语):

(哎呀,不能发布低于 10 点声誉的图片)

但问题是报告的 mdx 以不同的度量输出重复的 x2/x3/x4/x10 统计数据,这些统计数据被加载到不同级别的日历层次结构中(一些计划具有每年粒度,其他季度,事实数据位于精确的叶子级别日期)。这是 mdx 代码摘要:

/* Revenue plan-fact report for business units 
   (simplified translated abstact,
    initially built for new 2015 and old clients) */

    /*============================================================================
      CALCULATED MEASURES
      ============================================================================*/

        WITH    
        MEMBER [is new client] AS 
        CASE       
        WHEN [Clients].[First contract calendar].CURRENTMEMBER = 
             [Clients].[First contract calendar].[Year START DATE].&[2015-01-01T00:00:00] 
        THEN 1 ELSE 0 END       

        MEMBER [Measures].[New clients - Revenue Plan] AS 
               CASE WHEN [is new client] = 1 
               THEN [Measures].[New clients - Revenue Plan]
               ELSE null END

        MEMBER [Measures].[New clients - Revenue Fact] AS 
               CASE WHEN [is new client] = 1 
               THEN [Measures].[New clients - Revenue Fact]
               ELSE null END

        MEMBER [Measures].[New cients - contracts Plan] AS 
               CASE WHEN [is new client] = 1
               THEN [Measures].[New cients - contracts Plan]
               ELSE null END

    /*============================================================================
      CONSTRACT DATA SET
      ============================================================================*/

        SELECT {[Measures].[New clients - Revenue Plan],
                [Measures].[New clients - Revenue Fact],
                [Measures].[New cients - contracts Plan]} ON COLUMNS,

        --exists(
        --nonempty(    
        CrossJoin(
                  -- dimention of client's first contract calendar 
                  -- (we need it to calculate measure of new/old client flag):
                  -- drill down from years through quarters to monthes

                  Hierarchize(DrilldownMember({
                              {DrilldownLevel({[Clients].[First contract calendar].[Year START DATE]})}},
                                              {[Clients].[First contract calendar].[Quarter START DATE]})
                              -{[Clients].[First contract calendar].[Month START DATE].&[1899-12-30T00:00:00]}),

                  -- dimention of company's business structure (to show in report rows)

                  Hierarchize(DrilldownMember({
                              {DrilldownLevel({[Business structure].[Hierarchi].[ALL]})}},
                                              {[Business structure].[Hierarchi].[LV1].&[3]})
                              -{[Business structure].[Hierarchi].[ALL],                            
                                [Business structure].[Hierarchi].[LV1].&[3],
                                [Business structure].[Hierarchi].[LV2].&[3]})               
                  )
        --))        
        ON ROWS 

        FROM [DWH_FD_client_count]

这导致数据集在不同级别的日历层次结构中具有加倍的统计信息:

(哎呀,不能发布低于 10 点声誉的图片)

我已经尝试过exists()、nonempty()、nonemptycrossjoin() 和filter() 函数——但这都会导致部分业务部门出现统计数据空白。我认为根本问题是 Qube 测量的粒度。但我不能影响这一点,我需要在 Report Server 的 mdx 方面制作好数字。可能是,我需要修改 [Clients].[First contract calendar] 度量层次结构的钻取块。

请帮帮我,伙计们!我到现在两周都无法克服这个问题

4

2 回答 2

0

也许您需要将自定义度量包装在Sumor中Aggregate。尽管这些措施应该是递归的吗?您可能想尝试更改名称 - 我刚刚添加XX以将它们与定义中使用的度量区分开来:

    MEMBER [Measures].[New clients - Revenue Plan XX] AS
      SUM(               
         CASE WHEN [is new client] = 1 
           THEN [Measures].[New clients - Revenue Plan]
           ELSE null END
         )
    MEMBER [Measures].[New clients - Revenue Fact XX] AS 
      SUM(               
         CASE WHEN [is new client] = 1 
           THEN [Measures].[New clients - Revenue Fact]
           ELSE null END
         )

    MEMBER [Measures].[New cients - contracts Plan XX] AS 
      SUM(               
         CASE WHEN [is new client] = 1 
           THEN [Measures].[New cients - contracts Plan]
           ELSE null END
         )
于 2015-04-21T17:50:46.250 回答
0

这是解决方案,对我有用。问题似乎出现在 [Clients].[First contract calendar] 维度的层次结构钻探中,这导致错误的交叉连接其级别,输出过多的行和加倍的统计信息。为了使 mdx 正常工作,我刚刚替换了这个代码块:

Hierarchize(DrilldownMember({
                          {DrilldownLevel({[Clients].[First contract calendar].[Year START DATE]})}},
                                          {[Clients].[First contract calendar].[Quarter START DATE]})
                          -{[Clients].[First contract calendar].[Month START DATE].&[1899-12-30T00:00:00]})

仅使用一个层次结构属性调用:

[Clients].[First contract calendar].[Month START DATE]

注意:Reporting Services 中的输出数据集不仅生成 Monthes 列,而且还生成所有父层次结构级别:Years 和 Quarters,我最初尝试使用函数 Drilldownmember() 和 Drilldownlevel() 生成

于 2015-04-24T13:40:08.660 回答