对于其他有同样问题的人,并且追求 excel 那种效果,其中用户层次结构的维度仅为父母扩展,这是这样做的方法:
和
成员[措施]。[测试] AS
0
选择
{
[测试]
开 0,
非空{
筛选 (
{[dim user].[userhierarchy].[userlevel1].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel2].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel3].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel4].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel5].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel6].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel7].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel8].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel9].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
筛选 (
{[dim user].[userhierarchy].[userlevel10].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
)
} 开 1
FROM [活动]
查询将自动检查用户层次结构,并自动下降到必要的级别。感谢 Bill 提出他的解决方案并让我走上正轨。