Something like this might work:
SET @sql = NULL;
SELECT
GROUP_CONCAT(DISTINCT
CONCAT(
'MAX(IF(goals = ''',
goals,
''', round(value, 2), NULL)) AS ',
goals
)
) INTO @sql
FROM sgwebdb.dim_module;
SET @sql = CONCAT('SELECT alternative, ', @sql, ' FROM sgwebdb.dim_module GROUP BY alternative');
prepare stmt from @sql;
execute stmt;
Source: http://buysql.com/mysql/14-how-to-automate-pivot-tables.html
SQL Fiddle: http://sqlfiddle.com/#!2/ac9f88/10