在我的多维数据集中,我有上一年同期 [PY SAME Period] 的范围声明。
([Time Calculations].[PY Same Period]=
Aggregate(
CrossJoin
(
{[Time Calculations].[Current Period]},
PARALLELPERIOD(
case [Date].[Date Hierarchy].CurrentMember.LEVEL_NUMBER
when 4 then [Date].[Date Hierarchy].[Date]
when 3 then [Date].[Date Hierarchy].[Month]
when 2 then [Date].[Date Hierarchy].[Quarter]
when 1 then[Date].[Date Hierarchy].[Year]
end,
case [Date].[Date Hierarchy].CurrentMember.LEVEL_NUMBER
when 4 then 364
when 3 then 12
when 2 then 4
when 1 then 1
else null
end , [Date].[Date Hierarchy].CurrentMember )
))
);
这适用于一个日期,但不适用于一系列日期,包括开始日期和结束日期。
[Date].[Date Hierarchy].[Date].&[2020-01-20T00:00:00] - This works
{[Date].[Date Hierarchy].[Date].&[2020-01-01T00:00:00]:[Date].[Date Hierarchy].[Date].&[2020-01-20T00:00:00]} - doesn't work
如何让范围声明适用于这两种情况?