我在互联网上找到了以下示例,它为不同的[Measures].[Job Advert Value]
计算了总和[JAP ID].[JAP ID]
。
然而,它只显示了所有内容的总和,我想仅为每周总结一次。
我尝试为时间维度[Time].[Year - Week - Date].[Week].members
添加FILTER,但不起作用。
以下查询无需FILTER功能。
SCOPE([Time].[Year - Week - Date].[Week].members, [Permanent Placement Value].[Value Type Name].&[Vacancies], [Measures].[Job Advert Value] );
[Measures].[JAP Advert Value] =
SUM
(
generate
(
[JAP ID].[JAP ID].MEMBERS AS s,
s.CURRENT *
TAIL(
NonEmpty
(
[Time].[Year - Week - Date].[Date].members,
(s.CURRENT, [Measures].[Job Advert Value])
)
)
)
,
Measures.[Job Advert Value]
);
END SCOPE;
答案 0 :(得分:0)
我建议您尝试以下方法之一:
SCOPE([Time].[Year - Week - Date].[Week].members
, [Permanent Placement Value].[Value Type Name].&[Vacancies]
, [Measures].[Job Advert Value] );
[Measures].[JAP Advert Value] =
SUM(
GENERATE(
[JAP ID].[JAP ID].MEMBERS AS s
,s.CURRENT *
TAIL(
NONEMPTY(
EXISTING [Time].[Year - Week - Date].[Date].MEMBERS
,(
s.CURRENT
,[Measures].[Job Advert Value]
)
)
)
)
,Measures.[Job Advert Value]
);
END SCOPE;
或
SCOPE([Time].[Year - Week - Date].[Week].members
, [Permanent Placement Value].[Value Type Name].&[Vacancies]
, [Measures].[Job Advert Value] );
[Measures].[JAP Advert Value] =
SUM(
GENERATE(
[JAP ID].[JAP ID].MEMBERS AS s
,s.CURRENT *
TAIL(
NONEMPTY(
[Time].[Year - Week - Date].CURRENTMEMBER
,(
s.CURRENT
,[Measures].[Job Advert Value]
)
)
)
)
,Measures.[Job Advert Value]
);
END SCOPE;
另外,我建议您尝试使用以下内容进行示范:
SCOPE([Permanent Placement Value].[Value Type Name].&[Vacancies]
, [Measures].[Job Advert Value] );