Making a custom views field handler click sortable (getting an error when clicked)
Because this data is not stored in the database (it's just a dummy field that returns the result of some calculations) you can't make it click sortable as there is no database column to 'order by' in the SQL statement generated by the view. 

There must be a way around this but it's likely quite complicated and beyond me at the moment.

If you have a custom handler that does something to change the way you display existing field data you can make it click sortable by overriding the click_sort($order) function in your handler class. 

My mymodule.views.inc now looks like the below (where 'real field' is the name of the field included in the view, before the custom field created by my handler, but excluded from display)

&lt;?php 

function mymodule_views_data() {

    $data = array();

    $data['node']['mymodule_handler_myname'] = array(
        'title' =&gt; t('Score'),
        'help' =&gt; t('Makes score values human readable'),
        'real field' =&gt; 'value',
        'field' =&gt; array(
          'handler' =&gt; 'mymodule_handler_myname',
          'click sortable' =&gt; TRUE,
        ),
    ); 

    return $data;  

}

?&gt;


and my mymodule_handler_myname.inc looks like

&lt;?php

class mymodule_handler_myname extends views_handler_field {

    /**
    * Loads additional fields.
    */
    function query() {

    }  

    function click_sort($order) {

        $this-&gt;query-&gt;orderby[] = array(
            'field' =&gt; 'field_name', // here may be a field, or some SQL clause e.g. FIELD(str, str1, ...)
            'direction' =&gt; strtoupper($order),
        );

    }

    /**
    * Renders the field handler.
    */
    function render($values) {       

        if (isset($values-&gt;field_name)){

            switch ($values-&gt;field_name){
                case 2:
                    $vote = 'Yes';
                    break;
                case 0:
                    $vote = 'No';
                    break;
                default:
                    $vote = 'Maybe';
                    break;
            }

            return t($vote);

        }
    }
}

?&gt;


This wrecked my head for a full day so hopefully it's helpful to someone in the future.