Skip to main content

Table.PositionOf

Επιστρέφει τη θέση ή τις θέσεις της γραμμής μέσα στον πίνακα.

Syntax

Table.PositionOf(
table as table,
row as record,
optional occurrence as any,
optional equationCriteria as any
) as any

Remarks

Returns the row position of the first occurrence of the row in the table specified. Returns -1 if no occurrence is found.

  • table: The input table.
  • row: The row in the table to find the position of.
  • occurrence: (Optional) Specifies which occurrences of the row to return.
  • equationCriteria: (Optional) Controls the comparison between the table rows.

Examples

Example #1

Βρείτε τη θέση της πρώτης εμφάνισης της [a = 2, b = 4] στον πίνακα ({[a = 2, b = 4], [a = 6, b = 8], [a = 2, b = 4], [a = 1, b = 4]}).

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

Result:

0

Example #2

Βρείτε τη θέση της δεύτερης εμφάνισης της [a = 2, b = 4] στον πίνακα ({[a = 2, b = 4], [a = 6, b = 8], [a = 2, b = 4], [a = 1, b = 4]}).

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

Result:

2

Example #3

Βρείτε τη θέση όλων των εμφανίσεων της [a = 2, b = 4] στον πίνακα ({[a = 2, b = 4], [a = 6, b = 8], [a = 2, b = 4], [a = 1, b = 4]}).

Table.PositionOf(
Table.FromRecords({
[a = 2, b = 4],
[a = 1, b = 4],
[a = 2, b = 4],
[a = 1, b = 4]
}),
[a = 2, b = 4],
Occurrence.All
)

Result:

{0, 2}

Category

Table.Membership