如何在矩阵SSRS中显示空行和列

时间:2015-09-17 12:04:15

标签: reporting-services report mdx olap

我有一份报告,按产品ID和产品类型的列和行按周分组,将产品值归类为productValue。

即使数据不存在,我也需要显示所有周和productType。

这是我的mdx查询

SELECT NON EMPTY {
        [Measures].[Distributor Sale Out], 
        [Measures].[Distributor Sale Out Trend]
}
ON COLUMNS, 

NON EMPTY { 
          ([Date].[Calendar Week].[Calendar Week].ALLMEMBERS * 
           [Distributors].[Distributor].[Distributor].ALLMEMBERS * 
           [Distributors].[DistributorID].[DistributorID].ALLMEMBERS * 
           [Distributors].[City].[City].ALLMEMBERS * 
           [Product].[SKU].[SKU].ALLMEMBERS *
           [Product].[Product].[Product].ALLMEMBERS *
           [Date].[Calendar Year].[Calendar Year].ALLMEMBERS * 
           [SaleType].[SaleType].[Sale Type].ALLMEMBERS * 
           [SaleType].[Sale Type Id].[Sale Type Id].ALLMEMBERS ) } 

DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
           FROM ( SELECT ( STRTOSET(@DistributorsDistributorID, CONSTRAINED) ) ON COLUMNS 
                 FROM ( SELECT ( STRTOSET(@DateCalendarYear, CONSTRAINED) ) ON COLUMNS 
                         FROM [EFES SCM]
            )) 

非常感谢任何帮助 感谢

1 个答案:

答案 0 :(得分:0)

尝试删除NON EMPTYmdx的两个{1}}实例,看看会发生什么?

SELECT 
  {
    [Measures].[Distributor Sale Out]
   ,[Measures].[Distributor Sale Out Trend]
  } ON COLUMNS
 ,{
      [Date].[Calendar Week].[Calendar Week].ALLMEMBERS*
      [Distributors].[Distributor].[Distributor].ALLMEMBERS*
      [Distributors].[DistributorID].[DistributorID].ALLMEMBERS*
      [Distributors].[City].[City].ALLMEMBERS*
      [Product].[SKU].[SKU].ALLMEMBERS*
      [Product].[Product].[Product].ALLMEMBERS*
      [Date].[Calendar Year].[Calendar Year].ALLMEMBERS*
      [SaleType].[SaleType].[Sale Type].ALLMEMBERS*
      [SaleType].[Sale Type Id].[Sale Type Id].ALLMEMBERS
  }
  DIMENSION PROPERTIES 
    MEMBER_CAPTION
   ,MEMBER_UNIQUE_NAME
   ON ROWS
FROM 
(
  SELECT 
    StrToSet
    (@DistributorsDistributorID
     ,CONSTRAINED
    ) ON COLUMNS
  FROM 
  (
    SELECT 
      StrToSet
      (@DateCalendarYear
       ,CONSTRAINED
      ) ON COLUMNS
    FROM [EFES SCM]
  )
);