Hello, Here is the patch that fixes the Query wizard, it seems that it works fine now, however the problem mentioned in the patch was a minor problem, wizard worked wrong for all queries where I wanted to sort by an aggregate field. Please review it,and push it to git. Thanks, Gabor