简体   繁体   English

如何显示度量为null(mdx)的层次结构成员

[英]How to display hierarchy member where measure is null (mdx)

I want to display hierarchy in SSRS which include the members with null measure. 我想在SSRS中显示层次结构,其中包括具有零度量值的成员。 The problem in mdx query is that when I remove NON EMPTY clouse I got 'System.OutOfMemoryException' due to the large crossjoin between time, products and hierarchy dimension. mdx查询中的问题是,当我删除NON EMPTY clouse时,由于时间,乘积和层次结构维度之间的交叉连接较大,因此出现了“ System.OutOfMemoryException”。 Any idea how to soleve it? 知道如何忍受吗? The query is as follow: 查询如下:

SELECT 
NON EMPTY  { (
[Measures].[SOME MEASURE]
   )} ON COLUMNS,
   NON EMPTY { (
[Organization Structure].[Description].[Description].Allmembers
* [Organization Structure].[ID].[ID]
* [Organization Structure].[ParentID].[ParentID]
*[Products].[Name].[Name]
*[Time].[Hierarchy].[MothsAndDays]
)} 
DIMENSION
 PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, PARENT_UNIQUE_NAME, 
 LEVEL_NUMBER ON ROWS 
 FROM [MyCube]

Can you use the NonEmpty (without gap) function instead on the hierarchies you are ok to get rid of nulls? 您可以使用NonEmpty(无间隙)功能来代替层次结构吗? So for example: 因此,例如:

SELECT 
//NON EMPTY  
{ (
[Measures].[SOME MEASURE]
   )} ON COLUMNS,
//NON EMPTY 
{ (
[Organization Structure].[Description].[Description].Allmembers
* NONEMPTY([Organization Structure].[ID].[ID],[Measures].[SOME MEASURE])
* [Organization Structure].[ParentID].[ParentID]
* NONEMPTY([Products].[Name].[Name],[Measures].[SOME MEASURE])
* [Time].[Hierarchy].[MothsAndDays]
)} 
DIMENSION
 PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, PARENT_UNIQUE_NAME, 
 LEVEL_NUMBER ON ROWS 
FROM [MyCube]

Assuming the memory problems that you have appear on the Reporting Services server, not the Analysis Services server, you can use the HAVING clause at the end of the ROWS select part instead of NON EMPTY at the start of it to restrict the rows: 假设您在Reporting Services服务器(而不是Analysis Services服务器)上出现了内存问题,则可以在ROWS select部分的末尾使用HAVING子句代替其开头的NON EMPTY来限制行:

SELECT 
NON EMPTY  { (
[Measures].[SOME MEASURE]
   )} ON COLUMNS,

[Organization Structure].[Description].[Description].Allmembers
* [Organization Structure].[ID].[ID]
* [Organization Structure].[ParentID].[ParentID]
*[Products].[Name].[Name]
*[Time].[Hierarchy].[MothsAndDays]

DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, PARENT_UNIQUE_NAME, LEVEL_NUMBER 

HAVING <whatever the condition is to display a row>

ON ROWS 
 FROM [MyCube]

As you did not state exactly how you want to determine the rows that you want to display, I left that as <whatever the condition is to display a row> above. 由于您没有确切说明要确定要显示的行的方式,因此我将其保留为上面的<whatever the condition is to display a row> The way this works is that Analysis Services first builds up the result set for the complete cross product of all row hierarchies, and then evaluates the condition to remove rows from this. 这种工作方式是Analysis Services首先为所有行层次结构的完整叉积建立结果集,然后评估从中删除行的条件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM