Animation nodes - sorted group transformation
You can sort objects by using AN tools menu in T Tools tab:



Select all cubes, then in index panel press sort, and setup sort method. After this the objects will get unique integer value, that you can use in sort node. To copy this id, press RMB on this value slider and chose copy data path.



And paste this data path in sort list, after "e" 



Also you should try use initial transforms, that can be used similar way.