Distinct (MDX)

Vyhodnotí zadanou množinu, odstraní duplicitní n-tice z této množiny a vrátí výslednou množinu.

Syntax

  
Distinct(Set_Expression)  

Arguments

Nastavit_výraz
Platný výraz Multidimensional Expressions (MDX), který vrací množinu.

Remarks

Pokud funkce Distinct najde duplicitní n-tice ve specifikované množině, ponechá pouze první instanci duplicitní n-tice a pořadí množiny zůstává nedotčeno.

Examples

Následující příklad dotazu ukazuje, jak použít funkci Distinct s pojmenovanou množinou, stejně jako jak ji použít s funkcí Count k nalezení počtu různých n-tic v množině:

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]}  
MEMBER MEASURES.SETCOUNT AS  
COUNT(MySet)  
MEMBER MEASURES.SETDISTINCTCOUNT AS  
COUNT(DISTINCT(MySet))  
SELECT {MEASURES.SETCOUNT, MEASURES.SETDISTINCTCOUNT} ON 0,  
DISTINCT(MySet) ON 1  
FROM [Adventure Works]