閱讀英文

共用方式為


Table.ContainsAll

語法

Table.ContainsAll(table as table, rows as list, optional equationCriteria as any) as logical

關於

指出記錄清單 rows 中任何指定的記錄是否都顯示成 table 中資料列。 可指定選擇性參數 equationCriteria 以控制資料表資料列之間的比較方式。

範例 1

在只比較 [CustomerID] 資料行的情況下,判斷資料表是否包含所有資料列。

使用方式

Table.ContainsAll(
    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"]
    }),
    {
        [CustomerID = 1, Name = "Bill"],
        [CustomerID = 2, Name = "Fred"]
    },
    "CustomerID"
)

輸出

true

範例 2

判斷資料表是否包含所有資料列。

使用方式

Table.ContainsAll(
    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"]
    }),
    {
        [CustomerID = 1, Name = "Bill"],
        [CustomerID = 2, Name = "Fred"]
    }
)

輸出

false

方程式準則