此查询中计算出的成员[金额LM](=上个月的金额)有什么问题?如果我在行上指定时间似乎有效,但是即使我在where子句中有日期,我也不能指定时间。
WITH
MEMBER [Amount LM] as
(
[Measures].[Amount],
ParallelPeriod (
[Date].[Year - Quarter - Month - Date - Hierarchy].[Year and Month],
1,
[Date].[Year - Quarter - Month - Date - Hierarchy].CurrentMember
)
)
SELECT
{[Amount LM], [Measures].[Amount]} ON COLUMNS,
[Measure Types].[Name].&[22] --not related to [Measures].[Amount]; Used as a measure switch in the real case but adjusted here for simplicity
-- comment out the next line to fail
* [Date].[Year - Quarter - Month - Date - Hierarchy].[Year and Month]
ON rows
FROM [Cube]
WHERE [Date].[Year Number].&[2019]
;
工作案例的结果:
Amount LM | Amount
Costs | Jan 2019 | (null) | 109600
Costs | Feb 2019 | 109600 | 218300.5
Costs | Mar 2019 | 218300.5 | 392250
Costs | Apr 2019 | 392250 | 206800
Costs | May 2019 | 206800 | 174700
Costs | Jun 2019 | 174700 | 298400
Costs | Jul 2019 | 298400 | 264550
Costs | Aug 2019 | 264550 | 424100
Costs | Sep 2019 | 424100 | 129650
Costs | Oct 2019 | 129650 | 330050
Costs | Nov 2019 | 330050 | (null)
Costs | Dec 2019 | (null) | (null)
没有
* [Date].[Year - Quarter - Month - Date - Hierarchy].[Year and Month]
部分,金额LM ist NULL
|Amount LM| Amount
Costs | (null) | 2548400.5
您的计算没有问题。要了解为什么当您没有