I have a table:
id amount Y2016 Y2017 Y2018
1 100 1 1
2 200
3 300 2
4 400 2 3
5 500 1
and need to unpivot it and made some calculation Result table (multiply "amount" on years data):
id year amount
1 Y2017 100
1 Y2018 100
3 Y2016 600
4 Y2016 800
4 Y2017 1200
5 Y2018 500
Is it possible? And how?