fix query with nullable sums, which could occur for finance team