我想计算 2 个组的“数量”贡献百分比,第 1 组“客户 ID”出现多次,第 2 组“客户 ID”出现一次。例如:
|ID | OrderID |Quantity
|---|-------- |-----
|1 |10248 |12
|2 |10248 |10
|3 |10248 |5
|4 |10249 |9
|5 |10249 |40
|6 |10250 |10
- - -进入 - - -
OrderID |Quantity
10248 |27
10249 |49
10250 |10
----- 最终进入 -----
Group % tot Quantity
1 12% <--- Just OrderID 10250 since it has only 1 order
2 88%