【问题标题】:MDX 'is not equal to' in where clausewhere 子句中的 MDX '不等于'
【发布时间】:2016-02-16 14:59:15
【问题描述】:

到目前为止,我想将所有年份的 [Net sales] 除以 [Year][Week],但我遇到了问题。

我写了两个查询,但都不起作用。

第一个是基本的,我只显示[Net sales] 除以周和年,这正是我想要的,但首先:即使[Net sales] 为空,我也会显示周和年,其次,有“所有' 不希望出现的 [Year][Week] 的成员。

如何过滤掉[All] 和空值?

实际查询:

select  
{[Measures].[Net sales]} on columns,
{([Time].[Year].MEMBERS,
    [Time].[Week].MEMBERS )} on rows
from [Sales]
where ( 
{[Department].[Department name].&[WRO], [Department].[Department name].&[KAT]});

第二次查询,根本不起作用。这是尝试过滤掉[Year][All] 成员。

select  
{ [Measures].[Net sales] } on columns,
{ [Time].[Week].MEMBERS } on rows
from [Sales]
where ( except([Time].[Year].MEMBERS, [Time].[Year].&[All]),
    {[Department].[Department name].&[WRO], [Department].[Department name].&[KAT]});

总结:我只想显示净销售额除以周数。周应按年分组。

【问题讨论】:

    标签: mdx olap


    【解决方案1】:

    要过滤掉 [All] 成员,请使用 CHILDREN 而不是 MEMBERS。

    要获得没有净销售额的周和年,请使用 NON EMPTY:

       NON EMPTY {([Time].[Year].CHILDREN,
            [Time].[Week].CHILDREN )} on rows
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-25
      • 1970-01-01
      • 2021-04-11
      • 1970-01-01
      • 1970-01-01
      • 2014-05-03
      • 1970-01-01
      相关资源
      最近更新 更多