如何解决下面的问题?
ERR: mondrian.olap.fun.MondrianEvaluationException: mondrian.olap.InvalidArgumentException: Mondrian错误:参数无效。CDate函数的表达式参数的格式必须正确
我的MDX请求:
WITH
MEMBER
[Measures].[diff] as 'datediff("d",CDate([TimeDim.TimeHir].CurrentMember.Name),now())'
....
发布于 2015-02-04 02:04:01
您是否尝试过其他成员属性:
WITH
MEMBER [Measures].[diff] as
'datediff("d",CDate([TimeDim.TimeHir].CurrentMember.MEMBER_VALUE),now())'
或
WITH
MEMBER [Measures].[diff] as
'datediff("d",CDate([TimeDim.TimeHir].CurrentMember.MEMBER_key),now())'
或
WITH
MEMBER [Measures].[diff] as
'datediff("d",CDate([TimeDim.TimeHir].CURRENTMEMBER.Properties('Key0', Typed)),now())'
编辑
这一条适用于我对AdvWks
的攻击:
WITH
MEMBER [Measures].[Date_MEMBER_VALUE] as
[Date].[Calendar].CurrentMember.MEMBER_VALUE
MEMBER [Measures].[Diff_MEMBER_VALUE] as
datediff("D",CDate([Measures].[Date_MEMBER_VALUE]),now())
SELECT
{
[Measures].[Date_MEMBER_VALUE]
,[Measures].[Diff_MEMBER_VALUE]
}
ON 0,
tail([Date].[Calendar].[Date],12) ON 1
FROM [Adventure Works];
编辑
从这里看,蒙德里安似乎不存在.MEMBER_VALUE
,所以尝试使用上面的代码,只使用.VALUE
:http://mondrian.pentaho.com/documentation/mdx.php
发布于 2015-03-25 20:29:35
您可以使用DateSerial函数将您的值转换为CDate可接受的日期时间格式
https://stackoverflow.com/questions/28300839
复制相似问题