Sorting a resource by a calculated value'