下面怎么解决问题?
我的MDX请求:
WITH
MEMBER
[Measures].[diff] as 'datediff("d",CDate([TimeDim.TimeHir].CurrentMember.Name),now())'
....
答案 0 :(得分:1)
您是否尝试过其他会员资产:
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
在Mondrian中不存在,所以请尝试使用上面的代码而不只是.VALUE
:http://mondrian.pentaho.com/documentation/mdx.php
答案 1 :(得分:-1)
您可以使用DateSerial函数将您的值转换为CDate
接受的日期时间格式