===================================代码开始=======================================
WITH
MEMBER mydate as now()
select
{
[Measures].[Gi接口流量]
}
on 0,
{
Cousin(
strtomember("[时间].[日期层次].[月].&["+Format(mydate, "yyyy年MM月")+"]").prevmember,
strtomember("[时间].[日期层次].[月].&["+format(mydate, "yyyy年MM月")+"]").parent.parent.prevmembe
)
}on 1
from
[智能报告]
================================代码结束=====================================
Cousin返回与指定的子成员在父成员下方具有相同的相对位置的子成员。
Cousin( Member_Expression , Ancestor_Member_Expression )
参数
Member_Expression
返回成员的有效多维表达式 (MDX)。
Ancestor_Member_Expression
返回祖先成员的有效多维表达式 (MDX) 成员表达式。
=================================项目需求代码======================================
WITH
MEMBER mydate as now()
MEMBER [Gi接口流量同比值] as
(
Cousin(
strtomember("[时间].[日期层次].[月].&["+Format(mydate, "yyyy年MM月")+"]").prevmember,
strtomember("[时间].[日期层次].[月].&["+format(mydate, "yyyy年MM月")+"]").parent.parent.prevmember
),
[Measures].[Gi接口流量]
)
MEMBER [Gi接口流量同比增长值] as
iif
([Measures].[Gi接口流量同比值]<>0,
[Measures].[Gi接口流量]/[Measures].[Gi接口流量同比值]-1,0)
select
{
[Measures].[Gi接口流量],
[Measures].[Gi接口流量同比值],
[Measures].[Gi接口流量同比增长值]
}
on 0
from
[智能报告]
=================================项目需求代码结束=================================