Using a CTE for aggregating query when applying sort on compute field i get invalid sort criteria or something similar.