有没有办法指定每个单元格应该使用MDX返回?

时间:2022-07-01 09:25:28

I'm using a query of the form:

我正在使用表单的查询:

Select {
    ([Measures].[M1], [Time].[2000]),
    ([Measures].[M2], [Time].[2000]),
    ([Measures].[M1], [Time].[2001]),
    ([Measures].[M2], [Time].[2001])
} on 0
From [Cube]
Where
    ([Some].[OtherStuff])

using Analysis Services 2008. Even though I'm not specifying NON EMPTY or similar, I'm still only getting three of the cells back (one of them is null).

使用Analysis Services 2008.即使我没有指定NON EMPTY或类似的,我仍然只得到三个单元格(其中一个为null)。

How do I make sure that all the cells are brought back - even null ones?

如何确保所有细胞都被带回 - 即使是空细胞?

Additional thoughts: The query above isn't actually the one I'm running (surprisingly enough:) ). The real one has a couple of hierarchies from the same dimension specified as part of the select, and also as part of the where clause. I'm wondering if it's something to do with that, but I can't think what exactly.

其他想法:上面的查询实际上并不是我正在运行的那个(令人惊讶的是:))。真实的一个具有来自同一维度的几个层次结构,这些层次结构被指定为select的一部分,并且也是where子句的一部分。我想知道这是否与此有关,但我无法想到究竟是什么。

Additional additional thoughts:* This seems to be an AS2005/8 feature called Auto-Exists. Have a look at the relevant section on this MSDN article.

其他额外的想法:*这似乎是一个名为Auto-Exists的AS2005 / 8功能。请查看此MSDN文章的相关部分。

2 个解决方案

#1


You're pulling back different dimensions, which doesn't fly too well. Try this instead:

你正在拉回不同的尺寸,这种尺寸飞得不太好。试试这个:

with 
member [Time].[Calendar].[CY2000] as 
    ([Time].[Calendar].[2000], [Time].[Fiscal].[All Time])

member [Time].[Calendar].[FY2001] as
    ([Time].[Calendar].[All Time], [Time].[Fiscal].[2001])

select
    {[Time].[Calendar].[CY2000], [Time].[Calendar].[FY2001]}*
    {[Measures].[M1], [Measures].[M2]}
on columns
from [Cube]
where
    {[Some].[OtherOtherStuff]}

#2


Not an answer but this should help narrow down the problem, a query that replicates the issue in AdventureWorks

不是答案,但这应该有助于缩小问题范围,这是一个在AdventureWorks中复制问题的查询

SELECT

{ ( [Date].[Calendar].[Date].&[1], [Date].[Fiscal].[Date].&[1129] ) } on 0

FROM [Adventure Works]

I'd expect this to bring back the tuple specified and a Null, but instead no tuples are retrieved.

我希望这会带回指定的元组和Null,但是没有检索到元组。

I think this is because the tuple located on two hierarchies of the same dimension where there is no commonality.

我认为这是因为元组位于同一维度的两个层次结构中,没有共性。

#1


You're pulling back different dimensions, which doesn't fly too well. Try this instead:

你正在拉回不同的尺寸,这种尺寸飞得不太好。试试这个:

with 
member [Time].[Calendar].[CY2000] as 
    ([Time].[Calendar].[2000], [Time].[Fiscal].[All Time])

member [Time].[Calendar].[FY2001] as
    ([Time].[Calendar].[All Time], [Time].[Fiscal].[2001])

select
    {[Time].[Calendar].[CY2000], [Time].[Calendar].[FY2001]}*
    {[Measures].[M1], [Measures].[M2]}
on columns
from [Cube]
where
    {[Some].[OtherOtherStuff]}

#2


Not an answer but this should help narrow down the problem, a query that replicates the issue in AdventureWorks

不是答案,但这应该有助于缩小问题范围,这是一个在AdventureWorks中复制问题的查询

SELECT

{ ( [Date].[Calendar].[Date].&[1], [Date].[Fiscal].[Date].&[1129] ) } on 0

FROM [Adventure Works]

I'd expect this to bring back the tuple specified and a Null, but instead no tuples are retrieved.

我希望这会带回指定的元组和Null,但是没有检索到元组。

I think this is because the tuple located on two hierarchies of the same dimension where there is no commonality.

我认为这是因为元组位于同一维度的两个层次结构中,没有共性。