Table.IsDistinct
Angiver, om tabellen kun indeholder entydige rækker (ingen dubletter).
Syntax
Table.IsDistinct(
table as table,
optional comparisonCriteria as any
) as logical
Remarks
Angiver, om table
kun indeholder entydige rækker (ingen dubletter). Returnerer true
, hvis rækkerne er entydige. Ellers returneres false
. En valgfri parameter, comparisonCriteria
, angiver, hvilke kolonner i tabellen der skal undersøges for dubletter. Hvis comparisonCriteria
ikke er angivet, undersøges alle kolonner.
Examples
Example #1
Find ud af, om tabellen er entydig.
Table.IsDistinct(
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"],
[CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
})
)
Result:
true
Example #2
Find ud af, om tabellen er entydig i kolonnen.
Table.IsDistinct(
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"],
[CustomerID = 5, Name = "Bob", Phone = "232-1550"]
}),
"Name"
)
Result:
false
Category
Table.Membership