Late to the game here and not sure if this solves your specific use case, but if you're just needing them numbered in order dynamically based on your query you could use the Size function.
For Example if i have 1,000 students on the students table related to a Class on the class table, I could sort them by Date/Time they signed up for the class and then record ID by saying
//assume Date Joined is fid 30, Related Class is fid 20, and RID is 3 (per default)
var number position = Size(GetRecords("{3.LT.'"&[Record ID#]&"'}AND{30.LT.'"&[Date Joined]&"'}AND{20.EX.'"&[Related Class]&"'}"))
//add 1 to start index at 1 instead of 0
$position+1
This gives you the number of students that joined the Class they're Related to before the current record telling you if they were first (because the query = 0 and then we add 1) 545th or 1000th