Might be helpful if we can take a look at your app. If you have confidentiality concerns, you can scramble your data using the technique mentioned here:Preparing examples for Upload - Reduction and Data Scrambling
Use the sort expression for solving this task. Look at the attachement, please.
And if you want to create top 10 and bottom 10 the best (easiest) way to do this is create a two tables and restrict showed values with Dimension Limits tab. There is no need to try to accommodate both conditions into the one table.
Hope you'll find your problem solved!
instance41_net_sort.qvw 151.0 K