Change your running sum to order on QtySold.
Join that result to SELECT SUM(QtySold) AS GrandTotal FROM Prod_List.
Replace your CASE expression with (running/GrandTotal) DIV <#of buckets you want>.
This distributes the products into a best approximation equal height histogram by their percentage contribution to the total quantity. If you have very large outliers then you might have missing buckets because the big one will cover multiple percentage buckets.
Change your running sum to order on QtySold.
Join that result to SELECT SUM(QtySold) AS GrandTotal FROM Prod_List.
Replace your CASE expression with (running/GrandTotal) DIV <#of buckets you want>.
This distributes the products into a best approximation equal height histogram by their percentage contribution to the total quantity. If you have very large outliers then you might have missing buckets because the big one will cover multiple percentage buckets.