Table of contents
TOC
Collapse the table of content
Expand the table of content

Table.PositionOf

Owen Duncan|Last Updated: 4/19/2018

About

Determines the position or positions of a row within a table.

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

Arguments

ArgumentDescription
tableThe Table to check.
rowThe row to check for.
optional occurrenceThe number for the appropriate occurrence specification.
optional equationCriteriaAn optional value that specifies how to control comparison between the rows of the table.

Occurrence specification

  • Occurrence.First = 0

  • Occurrence.Last = 1

  • Occurrence.All = 2

Remarks

  • Table.PositionOf is similar to List.PositionOf but requires a table as input.

Examples

Table.PositionOf(   
 Table.FromRecords({  
 [A=1, B=2], [A=3, B=4], [A=1 B=6]}),   
 [A=3,B=4])  

 equals 1  
Table.PositionOf(  
 Table.FromRecords({  
 [A=1, B=2], [A=3, B=4], [A=1, B=6]}),   
 [A=1],   
 Occurrence.All, "A")  

 equals {0, 2}  
© 2018 Microsoft