我创建了如下图所示的层次结构:
http://i.stack.imgur.com/ErOXQ.png
在MDX查询
上Select [AccSetting].[UserN].[UserN] ON 1
FROM [Olap_report]
Where [AccSetting].[AgID].[115]
此查询返回UserN
的所有AgID 115
个孩子。但我想准确回复UserN
的{{1}}?
答案 0 :(得分:0)
我想我现在明白了 - 名字是会员的财产。
创建一个返回属性的自定义度量。
WITH
MEMBER [Measures].[NameColumn] AS
[AccSetting].[AgID].CURRENTMEMBER.Member_Name
MEMBER [Measures].[NameColumn2] AS
[AccSetting].[AgID].CURRENTMEMBER.Name
SELECT
{
[Measures].[NameColumn]
,[Measures].[NameColumn2]
} ON 0,
[AccSetting].[AgID].[115] ON 1
FROM [Olap_report]
msdn
的参考:
https://msdn.microsoft.com/en-us/library/ms145583.aspx
修改
首先检查成员是否存在:
SELECT
{
[Measures].[<add measure here>],
[Measures].[<add measure here>]
} ON 0,
{
[AccSetting].[AgID].[115],
[AccSetting].[AgID].[113]
} ON 1
FROM [Olap_report]