How can you calculate actual values using year-to-date values in SQL (using no bespoke function calls).
The source table:
Period
Site
Actual YTD
The Destination table:
Period
Site
Actual YTD
Actual
The YTD values start at period 1 and end at period 12. They start fresh each year. Once complete you should be able to perform a running sum on the Actual column and match the Actual YTD figure.
Example data:
Period 1 YTD Actual = 10
Period 2 YTD Actual = 25
Period 3 YTD Actual = 40
after calculating the actuals:
Period 1 Actual = 10
Period 2 Actual = 15
Period 3 Actual = 15
Any ideas?
The source table:
Period
Site
Actual YTD
The Destination table:
Period
Site
Actual YTD
Actual
The YTD values start at period 1 and end at period 12. They start fresh each year. Once complete you should be able to perform a running sum on the Actual column and match the Actual YTD figure.
Example data:
Period 1 YTD Actual = 10
Period 2 YTD Actual = 25
Period 3 YTD Actual = 40
after calculating the actuals:
Period 1 Actual = 10
Period 2 Actual = 15
Period 3 Actual = 15
Any ideas?