Using "SUM" for total of Labor Qty - Negative number being "Added" to total

I’ve created a BAQ that reports the number of Labor Hrs for a particular resource. I’ve been asked to add in the Labor Qty as well.

Using the aggregate “SUM” for the Labor Qty total I’ve noticed that instead of subtracting a Negative qty transaction it is adding it to the total qty.

What do I need to do to have it subtract?

Are you sure this value is actually negative? There’s no way that SUM is adding a negative number… Unless that number isn’t stored as a negative. Are you using absolute value perhaps?

Well I’m pulling the data from LaborDtl.LaborQty. The negative number is one that was made through ‘Job Adjustment’ would this make the number not a true negative number?

That does the value look like on the table?

-968.00

If the field shows up negative in the DB I don’t see how the SUM would add it…
image

Not sure what your are seeing but unless you are doing something else to turn that value positive (like use ABS) the SUM should work. What does your query/calculated field look like?

I got it…I was pulling two tables - LaborDtl and LaborHed. I realized that I wasn’t using LaborHed and so I deleted it. Once I did that, the qty’s came in as expected.

???

duplicate rows?

1 Like