计算成员作为由元组和集合过滤的现有度量
Calculated Member as an existing measure filtered by both a tuple and a set
我希望在 OLAP 多维数据集上使用 SQL Server Data Tools Analysis Services 创建一个计算成员,该多维数据集结合以下过滤方法:
元组
(
[Enrolment Planning Actuals].[Year].&[1],
[Enrolment Planning Actuals].[Attribute 1].&[Y],
[Enrolment Planning Actuals].[Attribute 2].&[N],
[Enrolment Planning Actuals].[Attribute 3].&[N],
[Measures].[Count]
)
设置为单个成员
SUM(
EXCEPT(
[Enrolment Planning Actuals].[Year].[Year],
{
[Enrolment Planning Actuals].[Year].&[1]
}
),
[Measures].[Count]
)
[Enrolment Planning Actuals].[Year]
的成员值为 1、2、3、4,我基本上希望计算成员提供 [Measures].[Count]
过滤条件:
- 包括除
[Enrolment Planning Actuals].[Year].&[1]
之外的所有 [Enrolment Planning Actuals].[Year]
成员
[Enrolment Planning Actuals].[Attribute 1].&[Y]
[Enrolment Planning Actuals].[Attribute 2].&[N]
[Enrolment Planning Actuals].[Attribute 3].&[N]
我认识到 SUM
函数可能是尝试组合这些过滤器的错误方法。
我发现文章 MDX Calculated member filter by dimension attribute 的已接受答案到目前为止非常有用。
也许这种思维方式从根本上是有问题的。欢迎提出建议,谢谢。
你快到了,兄弟。
只是扩展了 set
和 tuple
的概念,并添加了 crossjoin
或 *
的概念,下面是应该起作用的:
WITH MEMBER Measures.YourCalculatedMember AS
SUM(
EXCEPT(
[Enrolment Planning Actuals].[Year].[Year],
{
[Enrolment Planning Actuals].[Year].&[1]
}
) *
[Enrolment Planning Actuals].[Attribute 1].&[Y] *
[Enrolment Planning Actuals].[Attribute 2].&[N] *
[Enrolment Planning Actuals].[Attribute 3].&[N]
,
[Measures].[Count]
)
我认为您甚至可以删除度量并在属性层次结构之一上创建成员。然后你可以使用不同的措施来对抗它:
WITH MEMBER [Enrolment Planning Actuals].[Attribute 1].[YourCalculatedMember] AS
SUM(
EXCEPT(
[Enrolment Planning Actuals].[Year].[Year],
{
[Enrolment Planning Actuals].[Year].&[1]
}
) *
[Enrolment Planning Actuals].[Attribute 1].&[Y] *
[Enrolment Planning Actuals].[Attribute 2].&[N] *
[Enrolment Planning Actuals].[Attribute 3].&[N]
)
SELECT
{
[Measures].[Count],
[Measures].[Revenue]
} on 0,
{
[Enrolment Planning Actuals].[Attribute 1].[YourCalculatedMember],
[Enrolment Planning Actuals].[Attribute 1].&[Y]
} on 1
FROM [YourCube];
我希望在 OLAP 多维数据集上使用 SQL Server Data Tools Analysis Services 创建一个计算成员,该多维数据集结合以下过滤方法:
元组
(
[Enrolment Planning Actuals].[Year].&[1],
[Enrolment Planning Actuals].[Attribute 1].&[Y],
[Enrolment Planning Actuals].[Attribute 2].&[N],
[Enrolment Planning Actuals].[Attribute 3].&[N],
[Measures].[Count]
)
设置为单个成员
SUM(
EXCEPT(
[Enrolment Planning Actuals].[Year].[Year],
{
[Enrolment Planning Actuals].[Year].&[1]
}
),
[Measures].[Count]
)
[Enrolment Planning Actuals].[Year]
的成员值为 1、2、3、4,我基本上希望计算成员提供 [Measures].[Count]
过滤条件:
- 包括除
[Enrolment Planning Actuals].[Year].&[1]
之外的所有 [Enrolment Planning Actuals].[Attribute 1].&[Y]
[Enrolment Planning Actuals].[Attribute 2].&[N]
[Enrolment Planning Actuals].[Attribute 3].&[N]
[Enrolment Planning Actuals].[Year]
成员
我认识到 SUM
函数可能是尝试组合这些过滤器的错误方法。
我发现文章 MDX Calculated member filter by dimension attribute 的已接受答案到目前为止非常有用。
也许这种思维方式从根本上是有问题的。欢迎提出建议,谢谢。
你快到了,兄弟。
只是扩展了 set
和 tuple
的概念,并添加了 crossjoin
或 *
的概念,下面是应该起作用的:
WITH MEMBER Measures.YourCalculatedMember AS
SUM(
EXCEPT(
[Enrolment Planning Actuals].[Year].[Year],
{
[Enrolment Planning Actuals].[Year].&[1]
}
) *
[Enrolment Planning Actuals].[Attribute 1].&[Y] *
[Enrolment Planning Actuals].[Attribute 2].&[N] *
[Enrolment Planning Actuals].[Attribute 3].&[N]
,
[Measures].[Count]
)
我认为您甚至可以删除度量并在属性层次结构之一上创建成员。然后你可以使用不同的措施来对抗它:
WITH MEMBER [Enrolment Planning Actuals].[Attribute 1].[YourCalculatedMember] AS
SUM(
EXCEPT(
[Enrolment Planning Actuals].[Year].[Year],
{
[Enrolment Planning Actuals].[Year].&[1]
}
) *
[Enrolment Planning Actuals].[Attribute 1].&[Y] *
[Enrolment Planning Actuals].[Attribute 2].&[N] *
[Enrolment Planning Actuals].[Attribute 3].&[N]
)
SELECT
{
[Measures].[Count],
[Measures].[Revenue]
} on 0,
{
[Enrolment Planning Actuals].[Attribute 1].[YourCalculatedMember],
[Enrolment Planning Actuals].[Attribute 1].&[Y]
} on 1
FROM [YourCube];