用 MDX 查询的日期范围子句中现有的成员替换不存在的成员
我有一个从 SSAS 2005 多维数据集检索数据的 MDX 查询:
SELECT NON EMPTY { [Measures].[Record Count] } ON COLUMNS
FROM [Cube]
WHERE { [Dimension].[Date].[Day].&[2012]&[1]&[1]:[Dimension].[Date].[Day].&[2012]&[1]&[10] }
这通常运行良好。但是,当 2012 年 1 月 1 日没有记录时,似乎会替换为 NULL 值,并且查询会忽略该日期范围开始参数。
如何检查该维度成员是否存在并在该范围子句中使用另一个日期 (2012-01-02)(如果不存在)?
I have an MDX query that retrieves data from an SSAS 2005 cube:
SELECT NON EMPTY { [Measures].[Record Count] } ON COLUMNS
FROM [Cube]
WHERE { [Dimension].[Date].[Day].&[2012]&[1]&[1]:[Dimension].[Date].[Day].&[2012]&[1]&[10] }
This normally works well. However, when there are no records on 2012-01-01, it appears that a NULL value is substituted in and the query ignores that date range start parameter.
How can I check to see whether that dimension member exists and use another date (2012-01-02) in that range clause if it doesn't exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来是这样做的:
Looks like this did it:
子多维数据集查询是否有同样的问题?
Does a subcube query have the same issue?