Hello All,
I am attempting to restructure my data into a more horizontal format. As you can see from the screenshot below the data is structured where each transaction type is broken out into a different row. I would like to have all the information summed up onto one row. I have been attempting to use some transpose and cross tabs to get my desired output, but have yet to get it.
FYI The input Data has already been summarized hence the reason the column labels are "Sum Cost", but I want to receive the Sum of all the Sum cost if that makes sens.
Input Data
Month Year | Product | Method of Purchase | Transaction | Sum Cost | Sum Discount | Sum Net | Count |
2020 Q1 | Apple | Online | Purchased | 12.37 | 6.28 | 6.09 | 6 |
2020 Q1 | Apple | Online | Traded | 18.93 | 9.01 | 9.92 | 9 |
2020 Q1 | Apple | Online | Returned - A | 0 | 0 | 0 | 4 |
2020 Q1 | Apple | Online | Returned - B | 0 | 0 | 0 | 2 |
2021 Q1 | Apple | Online | Returned - C | 0 | 0 | 0 | 4 |
2020 Q1 | Apple | Online | Purchased | 12.37 | 0 | 12.37 | 6 |
2020 Q1 | Apple | Online | Returned - A | 0 | 0 | 0 | 3 |
2020 Q1 | Apple | Online | Purchased | 24.93 | 3.95 | 20.98 | 9 |
2020 Q1 | Apple | Online | Purchased | 8.99 | 4.22 | 4.77 | 3 |
Desired Output
Month Year | Product | Method of Purchase | Purchased Sum Cost | Purchased Sum Discount | Purchased Sum Net | Purchased Count | Traded Sum Cost | Traded Sum Discount | Traded Sum Net | Traded Count | Returned - A Count | Returned - B Count | Returned - C Count |
2020 Q1 | Apple | Online | 58.66 | 14.45 | 44.21 | 24 | 18.93 | 9.01 | 9.92 | 9 | 7 | 2 | 4 |