Add a «total for the quarter» column to the pivot
Same «product × month» report, but tack on a total column at the end of each row — that product's total sales across all three months. The output should be a single result set: product, three monthly sums (January, February, March 2024), and a final overall sum for the quarter. Sort by product.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| total | product | m_2024_01 | m_2024_02 | m_2024_03 |
|---|---|---|---|---|
| 370.00 | A | 100.00 | 150.00 | 120.00 |
| 280.00 | B | 80.00 | 90.00 | 110.00 |
| 215.00 | C | 60.00 | 70.00 | 85.00 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in