我正在使用内置时间智能功能,我想计算全年的措施 例如,如果当前日期成员是2015/03/01;我希望从2015/01/01到2015/12/31有一个计算的度量。
CREATE MEMBER CurrentCube.[DimTime].[FY-FQ-FM DimTime Calculations].[Full Year] AS "NA" ;
(
[DimTime].[FY-FQ-FM DimTime Calculations].[Year to Date]
, [DimTime].[Fiscal Year].[Fiscal Year].Members
, [DimTime].[Date].Members
, { [Measures].[Forecasts], [Measures].[Budget] }
)
= Aggregate(
{ [DimTime].[FY-FQ-FM DimTime Calculations].[Current DimTime] }
* PeriodsToDate(
[DimTime].[FY-FQ-FM].[Fiscal Year]
, [DimTime].[FY-FQ-FM].CurrentMember
)
) ;
答案 0 :(得分:0)
感谢@whytheq和@AkshayRane的帮助。 我能够在下面使用全年。
(
[DimTime].[FY-FQ-FM DimTime Calculations].[Full Year],
[DimTime].[Fiscal Year].[Fiscal Year].Members,
[DimTime].[Date].Members,
{
[Measures].[Forecasts],
[Measures].[Budget]
}
)
=
Aggregate(
{ [DimTime].[FY-FQ-FM DimTime Calculations].[Current DimTime] }
*
PeriodsToDate(
[DimTime].[FY-FQ-FM].[Fiscal Year],
(
ANCESTOR(
[DimTime].[FY-FQ-FM].CURRENTMEMBER,
[DimTime].[FY-FQ-FM].[Fiscal Year]
)
)
)
)