DistinctCount (MDX)DistinctCount (MDX)

QUESTO ARGOMENTO SI APPLICA A:sìSQL Server (a partire dalla versione 2008)noDatabase SQL di AzurenoAzure SQL Data Warehouse noParallel Data Warehouse THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Restituisce il numero di tuple distinte e non vuote in un set.Returns the number of distinct, nonempty tuples in a set.

SintassiSyntax


DistinctCount(Set_Expression)  

ArgomentiArguments

Set_ExpressionSet_Expression
Espressione MDX (Multidimensional Expression) valida che restituisce un set.A valid Multidimensional Expressions (MDX) expression that returns a set.

OsservazioniRemarks

Il DistinctCount funzione equivale a Count(Distinct(Set_Expression), EXCLUDEEMPTY).The DistinctCount function is equivalent to Count(Distinct(Set_Expression), EXCLUDEEMPTY).

EsempiExamples

Nell'esempio di query seguente viene illustrato l'utilizzo della funzione DistinctCount:The following query shows how to use the DistinctCount function:

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]

Vedere ancheSee Also

Numero ( Set ) ( MDX ) Count (Set) (MDX)
Riferimento alla funzione MDX ( MDX )MDX Function Reference (MDX)