The Expression engine (SQL) doesn’t allow to mix aggregate fields with non-aggregate fields, as it results in undefined behaviour.
Expression = SUM(ValueField_A) + ValueField_B
ValueField_A is inside an aggregation expression (SUM) and ValueField_B is not.
This results in an error :
“The following expression(s) contain(s) non aggregate field references and aggregate functions at the same time which is not allowed”
To solve this, think about the calculation you really want to do, and what will happen when it will be included in a GROUP BY operation.