In many of my apps I do something quite different though:
I have a custom state set on the repeating group. ie: “Active Data Type” which is just a text string.
I then have conditional statements on the repeating group that say "if the repeating group’s custom state Active Data Type = ‘open’ then data = ‘insert new search query searching for open orders’, same for closed orders.
Edit: adding more info
You then can create a workflow on button click that sets the new custom state. Element Actions -> All Elements -> Set State
This state is a text string, ie ‘Open’, if the open orders button was clicked.
By setting the data source to be a dynamic if/then variable you can swap out and sort data in a repeater pretty easily.