in my application I have orders with products, I need to count the orders with single products or combinations of product.
For example I have OrderID O0001 with product P1 and P2, so I would count this order for the combination of P1 and P2 (P1+2), Order O0002 has only the product P2, so I count this order as P2, O0003 will be counted for P2+3+4...
In the attached file a sample, the expeted result is
I was trying your requirement, it was quiet complex and one thing i want to suggest to you., see the attachment below in that table i have made a pivot in which the orderid which is in bolder is having more than one contribution of the products. can you please check if it is fine for you or not.