[英]Why does Excel Grand Total returns error (#VALUE!) when getting data from SSAS OLAP Cube (MDX)?
I am having a problem with Grand Total in Excel connected to a OLAP cube.我在连接到 OLAP 多维数据集的 Excel 中的总计有问题。 I have a measure that are correctly calculated in row level, but returns error in Grand Total.我有一个在行级别正确计算的度量,但在总计中返回错误。 Its returning me an error #VALUE.它返回给我一个错误#VALUE。 . .
EDIT: I have doing some experiences and verified that the error only appears when I have more then one year selected.编辑:我做了一些经验并验证了该错误仅在我选择了一年以上时才会出现。 If I have only one the data returns correct.如果我只有一个,则数据返回正确。
I try several alterations to the measure with no success.我尝试了几次对该措施的更改,但均未成功。
The origin measure:原产地测量:
IIF([Tipo de Stock].[Tipo de Stock].CurrentMember IS [Tipo de Stock].[Tipo de Stock].&[7] OR, NULL,
SUM({NULL:[Data].[Por Mês].PrevMember},[Measures].[Movimento Valor])
)
Some alterations trying to solve the problem:一些试图解决问题的改动:
IIF([Tipo de Stock].[Tipo de Stock].CurrentMember IS [Tipo de Stock].[Tipo de Stock].&[7] OR IsEmpty([Measures].[Movimento Valor]), NULL,
SUM({NULL:[Data].[Por Mês].PrevMember},[Measures].[Movimento Valor])
)
IIF([Tipo de Stock].[Tipo de Stock].CurrentMember IS [Tipo de Stock].[Tipo de Stock].&[7], NULL,
SUM({NULL:[Data].[Por Mês].PrevMember},IsEmpty([Measures].[Movimento Valor],0))
)
IIF([Tipo de Stock].[Tipo de Stock].CurrentMember IS [Tipo de Stock].[Tipo de Stock].&[7], NULL,
IsEmpty(SUM({NULL:[Data].[Por Mês].PrevMember},[Measures].[Movimento Valor]),0)
)
I have try also with CoalesceEmpty instead IsEmpty.我也尝试使用 CoalesceEmpty 而不是 IsEmpty。
Edit2:I try to implement a SCOPE and it returns values in Grand Total, but the Values are the SUM of all rows. Edit2:我尝试实现 SCOPE 并返回总计值,但值是所有行的总和。 The idea is that the grand total has the first value.这个想法是总计具有第一个值。
SCOPE([Measures].[Stock Inicial Valor]);
SCOPE([Data].[Por Mês].[Mês].members);
THIS = SUM({NULL:[Data].[Por Mês].PrevMember},[Measures].[Movimento Valor]);
END SCOPE;
END SCOPE;
Any one can help get to the right track.任何人都可以帮助走上正轨。
Thanks for all your help.感谢你的帮助。
Please try the following:请尝试以下方法:
IIF(
[Tipo de Stock].[Tipo de Stock].CurrentMember IS [Tipo de Stock].[Tipo de Stock].&[7]
OR [Data].[Por Mês].PrevMember IS NULL,
NULL,
SUM({NULL:[Data].[Por Mês].PrevMember},[Measures].[Movimento Valor])
)
I suspect the problem is that {Null:Null} isn't allowed so we are protecting against that in the new IIF statement.我怀疑问题是 {Null:Null} 是不允许的,所以我们在新的 IIF 声明中防止这种情况发生。
If that's not the problem then please install this free Excel extension and use this feature to get a proper error message to troubleshoot further.如果这不是问题,请安装此免费的 Excel 扩展并使用此功能获取正确的错误消息以进一步排除故障。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.