Sum Expression not summarizing Price as expected

I have a sum statement that doesn’t seem to be calculating as expected.

We have a quotes and commission table. There could be multiple records in the commission table for a single quote.

To sum the commission for each quote, I have a virtual field in the quotes table (vir_commission_act_pay) and display it on an email for the sales reps but it seems to be grabbing the last of the 2 records in this case vs. providing the Sum of the 2 records.

Records in Commissions table

Email Report field
image

Have you used Test in Expression Assistant to test your expression?

image

1 Like

Yes, the value is 0

So it sounds like your expression doesn’t work as you want. You’ll need to break it down to see where it fails. If you remove SUM() from around SELECT(), does Test show the expression returning only one value?

1 Like