@wsalling
You can create collection with specific amount of rows using the FirstN function.
In the FirstN function you can specify the number of rows that you want to be extracted and based on that you can create a new collection.
You can check the documentation for reference regarding the same.
I am also pasting the sample data so that you can use it as reference.
ClearCollect(test,{index:1},{index:2},{index:3},{index:4},{index:5},{index:6},{index:7}) - Create collection
ClearCollect(testa,FirstN(test,5)) - Filtered collection.
If the information helps you, please consider giving a thumbs up and mark solution as resolved.