Forum Discussion
ChristianDGreat
3 years agoResolver I
Sum if status is Invoiced
Hello,
I got stuck into these and probably need help.
So I have this table
| Order ID | Status | Qty |
| 1 | Open | 1 |
| 1 | Open | 2 |
| 1 | Open | 2 |
| 1 | Open | 3 |
| 1 | Open | 2 |
| 1 | Closed | 3 |
| 1 | Closed | 5 |
| 1 | Closed | 4 |
| 2 | Open | 1 |
| 2 | Open | 2 |
| 2 | Open | 1 |
| 2 | Open | 1 |
| 2 | Closed | 1 |
| 2 | Invoiced | 1 |
The result im looking for is this
| Order ID | Qty |
| 1 | 22 |
The logic here is if in the status there's a "Invoiced" it will ignore the order ID of it.
So in this case Order ID "2" has a "Invoiced" Status that means it ignores it in the result.
Order ID "1" doesnt have invoiced so it aggregate the qty. (sum)
Hope this helps:
1 Reply
- PadycosmosSolution Sage
Hope this helps: