Skip to main content

Table.ContainsAny

Indicates whether any of the specified records appear as rows in the table.

Syntax

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

Remarks

Indicates whether any the specified records in the list of records rows, appear as rows in the table. An optional parameter equationCriteria may be specified to control comparison between the rows of the table.

Examples

Example #1

Determine if the table <code>({[a = 1, b = 2], [a = 3, b = 4]})</code> contains the rows <code>[a = 1, b = 2]</code> or <code>[a = 3, b = 5]</code>.

Table.ContainsAny(
Table.FromRecords({
[a = 1, b = 2],
[a = 3, b = 4]
}),
{
[a = 1, b = 2],
[a = 3, b = 5]
}
)

Result:

true

Example #2

Determine if the table <code>({[a = 1, b = 2], [a = 3, b = 4]})</code> contains the rows <code>[a = 1, b = 3]</code> or <code>[a = 3, b = 5]</code>.

Table.ContainsAny(
Table.FromRecords({
[a = 1, b = 2],
[a = 3, b = 4]
}),
{
[a = 1, b = 3],
[a = 3, b = 5]
}
)

Result:

false

Example #3

Determine if the table <code>(Table.FromRecords({[a = 1, b = 2], [a = 3, b = 4]}))</code> contains the rows <code>[a = 1, b = 3]</code> or <code>[a = 3, b = 5]</code> comparing only the column [a].

Table.ContainsAny(
Table.FromRecords({
[a = 1, b = 2],
[a = 3, b = 4]
}),
{
[a = 1, b = 3],
[a = 3, b = 5]
},
"a"
)

Result:

true

Category

Table.Membership