SSAS OLAP yes/no 维度包括 yes 选项上的所有行

SSAS OLAP yes/no Dimension including all rows on yes option

我需要向我的 OLAP 多维数据集添加一个新维度来过滤一些 rows

基本上,如果用户 select "yes" 它应该出现在所有行中。如果用户 select "no" 它应该出现标识的行。

我的事实 table 中有一个 column01 (no/yes)..

我的问题是,如果用户 select 是,我需要 "ignore" 此列,只有在 select 否时才查找它。

我考虑过垃圾维度,但为此我需要有两个属性。

任何建议

谢谢

无法创建这样的维度。您需要在用户 select yes/no 所在的应用程序中处理此问题。

"filtering some rows in cube" 你的意思是如果在你的维度中选择 [No] 成员则应用过滤器,对吗?否则显示所有度量,就像没有过滤器一样。

选择[是]时,您可以使用范围重定向到[all]成员?

SCOPE([YourDimension].[Yes]);
THIS=[YourDimension].[All];
END SCOPE;

这应该适用于您在多维数据集中的每个度量。

此外,即使不允许cube ALTER,也可以分两步实现:

  1. 为所有(未过滤的)值创建度量。
  2. 只对某些成员显示。

例如[CY 2013] = 你的 [是]:

with
member [2013 is ALL] as ([Measures].[Order Count],[Date].[Calendar Year].[All])

member [2013] as
 iif([Date].[Calendar Year].CurrentMember is [Date].[Calendar Year].&[2013]
  or [Date].[Calendar Year].CurrentMember is [Date].[Calendar Year].[All Periods]
  ,[2013 is ALL],[Measures].[Order Count])

select {[Measures].[Order Count],[2013 is ALL],[2013]} on 0
,[Date].[Calendar Year].members on 1
from [Adventure Works]

但请先尝试 SCOPE。因为它可以应用于任何度量,甚至还没有创建。