简体   繁体   中英

SSAS MDX NonEmpty issue

I am having issues when running the query:

WITH MEMBER [Measures].[Test1] AS
(
SUM({NONEMPTY(EXISTING(([Product].[Product].[All].Children,[Month].[Month].[All].Children])),  [Measures].[Measure1])}, [Measures].[Measure1])
)
SELECT {[Measures].[Test1],[Measure1]} ON 0
([Product].[Product].Children) ON 1
FROM
[CUBE]
WHERE
([Month].[Month].[Jan]:[Month].[Month].[Dec])

Based on my limited knowledge of MDX, I assume [Test1] and [Measure1] should return the same results.

Depending on what I put in the where clause (ie I change the months) I can get no results for [Test1], even if there are values for [Measure1].

If I change [Measure1] to another measure from the same fact table [Measure2] this problem does not occur.

[Measure1] is just a standard measure, it is not calculated or scoped, etc. I know NONEMPTY doesn't need to be there and the query works as expected if I remove it, but I would like to know why it seems to filter out non-empty data.

Gents (and ladies), it looks like this is actually a Microsft Analysis Services Bug. http://support.microsoft.com/kb/2606211 I installed the cumulative update and it has resolved this issue.

Well I would remove the existing . I see no reason for using it and it may cause the error, according to

By default, sets are evaluated within the context of the cube that contains the members of the set. The Existing keyword forces a specified set to be evaluated within the current context instead.

Source

It seems that your query is executed in another context.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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