I would like a 3rd column next to #Orders that shows a % of how many distinct customers have had more than 1 order.
In this example, User1 has 44 distinct customers who have placed an order. But 45 Orders have been made in total, so 1 customer has placed 2 orders. so in the 3rd column I would like to see [amount of distinct customers with multiple orders] / [amount of distinct customers with at least 1 order = column(1)]. This would be 2.27% in the case of User1. If I just do (#orders-column(1) ) / column(1) , it doesn't take into account that 1 customer could have placed 3, 4, 5, or more orders. If User1 has 44 customers with at least 1 order, but placed 46 orders in total. Of which 3 at the same customer, then I would like the statement to take that 1 customer with more than 1 order, divide by 44. Giving 2.27% and not 4.55% as it would with the present statement.
For the other Users, they have as many orders as customers with at least 1 order, so stands to reason that the 3rd should have to be 0 for them or NULL.