返回员工数量> 1 MDX SQL Server 2012

时间:2018-04-07 20:27:11

标签: sql-server-2012 mdx mdx-query

我正在尝试编写一个简单的MDX查询来获取多个员工的计数。我能够在行中使用过滤器但是如何才能使查询只返回计数大于1的值?

select NON EMPTY {[Measures].[Employee Count]} ON COLUMNS,
    [Employee].[Employee ID].[Employee ID] ON ROWS
from [Human Capital]

enter image description here

1 个答案:

答案 0 :(得分:2)

试试这个:

WITH MEMBER [Measures].[Employee Count 2+] as
 IIf(
  [Measures].[Employee Count]>1,
  [Measures].[Employee Count],
  Null
 )
select {[Measures].[Employee Count 2+]} ON COLUMNS,
   NON EMPTY [Employee].[Employee ID].[Employee ID].Members ON ROWS
from [Human Capital]