By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
12 rows affected
| week_number | product_category | sum_incoming_amount | sum_outgoing_amount |
|---|---|---|---|
| 1 | cat1 | 5 | null |
| 2 | cat1 | null | 5 |
| 3 | cat2 | null | 6 |
| 4 | cat2 | 8 | 8 |
| 4 | cat3 | 6 | null |
| 11 | cat1 | 6 | null |
| 11 | cat3 | 4 | null |
| 15 | cat1 | null | 10 |