Function editor for QGIS expressionshttp://nathanw.net/2015/01/19/function-editor-for-qgis-expressions/