找不到特定实体时如何克服MDX查询错误 [英] How to Overcome MDX Query Error When It Can't Find Specific Entity

查看:54
本文介绍了找不到特定实体时如何克服MDX查询错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行MDX查询时:

When i run MDX query like:

select {[Measures].[all_accounts]} ON COLUMNS,

{{[Country].[Country].[Country].&[italy]}*
{[TD].[TD].[date].&[2016-09-02T03:00:00.000]:[TD].[TD].[date].&[2016-09-02T03:08:00.000]},
{[Country].[Country].[Country].&[Germany]}*
{[TD].[TD].[date].&[2016-08-16T04:00:00.000]:[TD].[TD].[date].&[2016-08-16T04:03:00.000]}}

ON ROWS

FROM [cube]

我收到一个错误消息,因为"italy"不是在国家/地区"维度中找到的实体.而且没有结果回来.

i get an error because 'italy' is not an entity found in Country dimension. and no result is coming back.

我希望能够运行mdx而不必知道维度中的实体名称,而只为存在的实体获取结果.在此示例中为德国".我该如何克服这个问题?

i want to be able to run the mdx without necessarily knowing the entities names in the dimension and get back a result only for those that exists. in this example 'Germany'. how can i overcome this problem?

推荐答案

您可以更改服务器的配置,

You can change the configuration of the server, icCube.xml, to convert not found members to null (it's risky).

icCube.mdxEvalUnknownMemberError

如果您不想为整个服务器更改此设置,则可以在每个MDX查询中使用注释.例如,以下查询将不会为缺少的& [_ FR]成员返回任何内容:

If you do not want to change this setting for the whole server you can use an annotation with each MDX query. For example, the following query will not return anything for the missing &[_FR] member:

//#prop( icCube.mdxEvalUnknownMemberError = false )
select { 
  [Geography].[Geo].[Country].&[FR_], 
  [Geography].[Geo].[Country].&[US] 
} on 0 from [Sales]

这篇关于找不到特定实体时如何克服MDX查询错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆