我有一个要求,我必须获取不同度量的值,每个度量都有自己的日期范围,以下查询有效并让我获得一年多的数据,
WITH MEMBER [Measures].[Ex1] AS ([Measures].[Average Spending], [Date].[Year].&[2020])
MEMBER [Measures].[Ex2] AS ([Measures].[Average Time Spent], [Date].[Year].&[2019])
SELECT {[Customer].[Name].[Name]} ON 1, {[Measures].[Ex1],[Measures].[Ex2]} ON 0 FROM [Model];
但是当我尝试传递一个日期范围而不是年份时,我得到了一个错误,
WITH MEMBER [Measures].[Ex1] AS ([Measures].[Average Spending], [Date].[Year].&[2020])
MEMBER [Measures].[Ex2] AS ([Measures].[Average Time Spent], [Date].[Date].[01-May-2020]:[Date].[Date].[31-May-2020])
SELECT {[Customer].[Name].[Name]} ON 1, {[Measures].[Ex1],[Measures].[Ex2]} ON 0 FROM [Model];
我收到以下错误,
执行查询...该函数需要一个字符串或数字表达式作为参数。使用了元组集表达式。运行完成
如何获取每个计算成员的日期范围的度量?