
Total count/sum with greater than condition
We have requirement to get total Purchase order count & sum of Purchase order amount for only suppliers greater than 2 purchase orders.
Can you please help achieve total count along with having condition.
Sample Input data:-
Category | Supplier Name | PO Number | PO Amount |
Food | SUP1 | PO1 | $100 |
Service | SUP2 | PO2 | $200 |
Food | SUP2 | PO3 | $100 |
Merchandise | SUP3 | PO4 | $600 |
Service | SUP4 | PO5 | $50 |
Food | SUP1 | PO6 | $100 |
Food | SUP1 | PO7 | $100 |
Service | SUP2 | PO8 | $200 |
Food | SUP2 | PO9 | $100 |
Merchandise | SUP5 | PO10 | $600 |
Service | SUP1 | PO11 | $50 |
Food | SUP5 | PO12 | $100 |
sample output:-
Category | Total Suppliers | Total PO's | Total PO Amount |
Food | 3 | 6 | $600 |
Service | 2 | 3 | $450 |
Merchandise | 1 | 1 | $600 |
Like
Follow
1
7replies