我有以下MDX查询来计算主动机会asofdate(由大于开始日期和小于关闭日期定义)
当日期值是硬编码时,这是有效的。但是我想让它与.currentmember一起工作,它接受层次结构中的成员并计算两个日期之间的开放机会
with member
[Measures].[Cumulative_count_dates]
as
AGGREGATE(
{NULL:[Time Dimension].[Year-Qtr-Month-Date].[Date].&[2011-10-09T00:00:00]} * {[Opportuntity Close Dt].[Year-Qtr-Month-Date].[Date].&[2011-10-11T00:00:00] : NULL}
, [Measures].[Opportunities Count]
)
select {[Measures].[Cumulative_count_dates]} on columns,
NON EMPTY {[Time Dimension].[Year-Qtr-Month-Date].members} on rows
from AdventCube
换句话说,我希望将其作为变量传递
[Time Dimension].[Year-Qtr-Month-Date].[Date].&[2011-10-09T00:00:00]
请帮忙。
答案 0 :(得分:0)
CurrentMember出了什么问题?
with member
[Measures].[Cumulative_count_dates]
as
AGGREGATE(
{NULL:[Time Dimension].[Year-Qtr-Month-Date].CurrentMember} * {[Opportuntity Close Dt].[Year-Qtr-Month-Date].[Date].&[2011-10-11T00:00:00] : NULL}
, [Measures].[Opportunities Count]
)
select {[Measures].[Cumulative_count_dates]} on columns,
NON EMPTY {[Time Dimension].[Year-Qtr-Month-Date].[Date].members} on rows
from AdventCube