Sorry I need to make sure i understand your data and your needed output before I could try and offer a solution for this.
This
"but they only need to subtract if there a negative number if there positive they need to add up. Loc 1 might show -10 and loc 2 shows 5 then the available should be -5."
is confusing me.
Is the iminvloc_sql.qty_on_hand always a positive value in your raw data set (before you apply any formula to it)?
Your description above implies that you start out with both positive and negative values.
If that is the case you should just be able to sum the quantity at the group item level.
Your first post implies that the all 3 locations have positive values but you need to know the difference in quantity between loc 1 from loc 2 and 3 combined.
Your more recent post implies that you just want to know the total of all 3 and some might be positive values, other might be negative values.
Please explain further.
Thanks