Hi,
I'm trying to create a difference row within the data between the years and stores. See the following for the sample data.
Item | Year | Store 1 | Store 2 | Store 3 |
1 | 2016 | 100 | 300 | 450 |
1 | 2017 | 200 | 200 | 500 |
2 | 2016 | 400 | 90 | 900 |
2 | 2017 | 900 | 50 | 800 |
3 | 2016 | 200 | 430 | 300 |
3 | 2017 | 500 | 200 | 600 |
Here is the sample result that I would like:
Item | Year | Store 1 | Store 2 | Store 3 |
1 | 2016 | 100 | 300 | 450 |
2017 | 200 | 200 | 500 | |
Diff | 100 | -100 | 50 | |
2 | 2016 | 400 | 90 | 900 |
2017 | 900 | 50 | 800 | |
Diff | 500 | -40 | -100 | |
3 | 2016 | 200 | 430 | 300 |
2017 | 500 | 200 | 600 | |
Diff | 300 | -230 | 300 |
I was thinking I could use multiple cross, do the calculation for diff and transpose it back. Is there another way to do it without creating multiple cross per store?
Thank you for your help in advance.
Solved! Go to Solution.