Must be analog to Average code

http://www.fabrikar.com/forums/index.php?threads/sql-error-1064-grouping-by-user-element-when-field-element-calculation-sum.39542/