You cannot sort by a global text field in views by default.
This is because global text field values are not populated until the view is being rendered, but the sorting of the view is done in the sql query, which is much before the global text field value exists.
One way to do it would be to add sorting ability with javascript.
Because this would happen on the front end it could work for any fields.
The views tablesorter module does this for drupal 6 table views but I have not yet found the time to make a drupal 7 version.
Another option is to make a custom views field handler that actually includes the data in the sql query or just making a custom sort handler.
For more information on creating handlers install the advanced help module and then go to the advanced help UI and look at the views help (advanced_help/views).