Ssas SELF\u BEFORE\u AFTER-为什么不返回相关级别的成员?
这是我的剧本:Ssas SELF\u BEFORE\u AFTER-为什么不返回相关级别的成员?,ssas,Ssas,这是我的剧本: WITH SET [Set_TargetEmp] AS { FILTER( [Employee Department].AllMembers, ( InStr( 1, [Employee].[Employee Department].currentmember.name,
WITH
SET [Set_TargetEmp] AS
{
FILTER(
[Employee Department].AllMembers,
(
InStr(
1,
[Employee].[Employee Department].currentmember.name,
"REUBEN") <> 0
)
)
}
SELECT
DESCENDANTS(
[Set_TargetEmp],
[Employee].[Employee Department],
SELF_BEFORE_AFTER)
ON 1,
{} ON 0
FROM [Adventure Works]
后代只返回后代,即。E成员的级别低于第一个参数。你需要的是一份工作。但是,根据文档,祖先和函数不允许将集合作为第一个参数。这意味着-假设您的集合可能包含多个成员-您必须使用来迭代[set_TargetTemp]的成员:
实际上,我并不经常使用后代函数。但就我所理解的文档而言,它指的是Decentants级别的第二个参数。对于后代[部门]、[生产]、[员工],在前将是头衔级别。@FrankPI好的-我将进行实验…在提到第一个参数后,我认为SELF_在前_。@FrankPI-过去两个问题背后的基本推理是我想要一个类似于Proclarity/Pyramid的搜索函数的脚本。@。。。。我输入一个字符串,然后脚本返回所有较高和较低级别的亲戚。我将开始另一个问题,因为可能有一个更简单的方法。@FrankPI……我作为新问题提出的最后一条评论
SELECT
DESCENDANTS(
[Employee].[Employee Department].[Employee].[Reuben H. D'sa],
[Employee].[Employee Department],
SELF_BEFORE_AFTER)
ON 1,
{} ON 0
FROM [Adventure Works]
WITH
SET [Set_TargetEmp] AS
{
FILTER(
[Employee Department].AllMembers,
(
InStr(
1,
[Employee].[Employee Department].currentmember.name,
"REUBEN") <> 0
)
)
}
SELECT
{} ON 0,
Generate([Set_TargetEmp] as e,
{Ancestor(e.Current, [Employee].[Employee Department].[Department])}
)
ON 1
FROM [Adventure Works]