Table.MatchesAllRows

構文

Table.MatchesAllRows(table as table, condition as function) as logical

バージョン情報

table 内のすべての行が、指定された condition を満たしているかどうかを示します。 すべての行が一致する場合は true を、それ以外の場合は false を返します。

例 1

テーブルの列 [a] のすべての行の値が偶数かどうかを調べます。

使用方法

Table.MatchesAllRows(
    Table.FromRecords({
        [a = 2, b = 4],
        [a = 6, b = 8]
    }),
    each Number.Mod([a], 2) = 0
)

出力

true

例 2

({[a = 1, b = 2], [a = 3, b = 4]}) テーブルのすべての行の値が [a = 1, b = 2] かどうかを調べます。

使用方法

Table.MatchesAllRows(
    Table.FromRecords({
        [a = 1, b = 2],
        [a = -3, b = 4]
    }),
    each _ = [a = 1, b = 2]
)

出力

false