DistinctCount (MDX)

返回集中非重复的非空元组的数目。

语法

DistinctCount(Set_Expression)

参数

  • Set_Expression
    返回集的有效多维表达式 (MDX)。

注释

DistinctCount 函数等效于 Count(Distinct(Set_Expression), EXCLUDEEMPTY)。

示例

以下查询说明如何使用 DistinctCount 函数:

WITH SET MySet AS

{[Customer].[Customer Geography].[Country].&[Australia],[Customer].[Customer Geography].[Country].&[Australia],

[Customer].[Customer Geography].[Country].&[Canada],[Customer].[Customer Geography].[Country].&[France],

[Customer].[Customer Geography].[Country].&[United Kingdom],[Customer].[Customer Geography].[Country].&[United Kingdom]}

*

{([Date].[Calendar].[Date].&[20010701],[Measures].[Internet Sales Amount] )}

//Returns the value 3 because Internet Sales Amount is null

//for the UK on the date specified

MEMBER MEASURES.SETDISTINCTCOUNT AS

DISTINCTCOUNT(MySet)

SELECT {MEASURES.SETDISTINCTCOUNT} ON 0

FROM [Adventure Works]

请参阅

参考

Count(集)(MDX)

MDX 函数参考 (MDX)