Is possible to sort a views field that is generated by custom views handler? I have a view field that is generated by a views handler.
The logic inside the render method is as following:

function render($class) {

  if (class_hasnt_started($class)) return 'Registered';

  if (user_completed_entire_course($class)) return 'Completed';

  if (user_completed_some_classes($class)) return 'Attended x of y';

}


My question is, can such a field be sorted?
For a Table display, use the style options to make the field sortable.