我需要将维度成员作为计算度量返回。
假设:
尺寸
措施
关系
我正在尝试执行以下操作:
创建计算的度量值,这些度量将返回销售人员,该客户具有在角色中记入的最大$ s。 e.g。
| Customer | Director | Manager | Value |
|-------------------|----------|---------|-------|
| ACME | Bob | Fred | 500 |
| EMCA | Bob | Fred | 540 |
| Universal Imports | Mary | Joe | 1000 |
| Universal Exports | Mary | Fred | 33 |
我想将此作为一种计算方法,我可以在任何客户都是ROW的情况下使用。
答案 0 :(得分:1)
如果我能正确理解你的问题,那么沿着这条线就可以解决问题(当然你必须使用正确的关卡,层次结构和多维数据集名称):
with
member [Measures].[DirectorTemp] as topcount([Salesperson].[Salesperson].members,1,([Measures].[Credited Value],[Credit Type].[Director],[Customer].currentmember)).item(0).properties("Caption")
member [Measures].[Director] as iif([Measures].[DirectorTemp] = [Salesperson].UnknownMember.properties("caption"), null, [Measures].[DirectorTemp])
member [Measures].[ManagerTemp] as topcount([Salesperson].[Salesperson].members,1,([Measures].[Credited Value],[Credit Type].[Manager],[Customer].currentmember)).item(0).properties("Caption")
member [Measures].[Manager] as iif([Measures].[ManagerTemp] = [Salesperson].UnknownMember.properties("caption"), null, [Measures].[ManagerTemp])
select
{[Measures].[Director],[Measures].[Manager],[Measures].[Value]} on 0,
{[Customer].members} on 1
from MyCube