Hi,
The sales are counted when the stock is incremented/decremented. So the status of the orders being taken into account depends on how the order statuses are configured for the "invoice" column in the System>Order statuses menu and the option "Update the product stock on confirmed status" of the HikaShop configuration. Note however that the sales already counted won't be affected by changing these, it would only affect new orders.
Regarding the product_name being empty, that's probably because you didn't set any name in each variant of the product.
While you can do many things in different ways, your case is quite specific and it is indeed touching on the edges of what's possible by default.
You could also use the order data like you had before, export it instead of displaying it and then open it in Excel and sum the elements with the same names with a small excel script. That way, you would have an easier control on the data as the quantities taken into account would be dynamically retreived from the orders and not an accumulation of the sales updated each time an order would be placed or paid.