Wtd
返回与给定成员相同级别的兄弟成员集合,从第一个兄弟成员开始,到给定成员结束,这受时间维度中的周级别的限制。
语法
WTD( [member] )
参数
Member | 是时间类型维度中的成员。 |
备注
周级别的名字必须为WEEKS(不区分大小写)。
示例一
select {[Organization].&[6]} on columns, {WTD([Time].[2013].[9].[Thursday])} on rows from [Week AdventureWorks]
where ([DepartmentGroup].&[6],[Scenario].&[1],[Account].&[60])
运行结果:
Account: Salaries
DepartmentGroup: Research and Development
Scenario: Actual
Time | Southeast Division |
Sunday | NaN |
Monday | NaN |
Tuesday | NaN |
Wednesday | NaN |
Thursday | 21039.00 |
指定成员的月份为2013年第9周的Thursday,所以行上为Sunday至Thursday(第9周)。
示例二
with member [Account].[x] as Sum(WTD([Time].currentmember),[Account].&[60])
select {[Organization].&[6]} on columns, {[Account].[x]} on rows from [Week AdventureWorks]
where ([DepartmentGroup].&[6],[Scenario].&[1],[Time].[2013].[9].[Thursday])
运行结果:
DepartmentGroup: Research and Development
Scenario: Actual
Time: 3
Account | Southeast Division |
x | 21039.00 |
维度Time的当前成员为2013年第9周的Thursday,所以代入wtd函数后返回从2013年第9周的Sunday至2013年第9周的Thursday共5个成员(如示例1所示),所以结果值为对应的5个单元格的值的和。