I want to build a sum out of two columns which are factors of a multiplication. Please see the sample data:
+------------+-------------+
| Amount | Rate |
+------------+-------------+
| 8 | 4.1 |
| 3 | 2.5 |
| 7 | 5.3 |
+------------+-------------+
so I have this table and I am struggling with the total amount of these results of the multiplication. I could have built a third column and calculate (8*4.1)+(3*2.5)+(7*5.3)
but instead I want to do it directly out of the two columns. So far I used
sum(amount) * sum(rate)
but it doesn't give me the right results. Can anyone please help me and tell me what the right formula is?
Thank you very much!
sum(amount*rate)
(8*4.1)+(3*2.5)+(7*5.3)
is not the same as(8 + 3 + 7) * (4.1 * 2.5 * 5.3)
, right?