Hello Forum Members,
I have to calculate a Trend value.
I have Promised, Trend, Expected, Actual, Date columns.
Trend Logic:
- Past dates including current month (promised-actual)
- Future dates (promised-Expected)
Region | Promised | Trend | Expected | Actual | Date | Trend Logic |
North | 100 | 50 | 200 | 50 | January, 2014 | Past dates (promised-actual) |
South | 200 | 100 | 100 | 100 | February 2014 | Past dates (promised-actual |
East | 100 | 50 | 200 | 50 | June 2014 | Past dates (promised-actual |
West | 400 | 100 | 300 | 200 | September, 2014 | Future dates (promised-Expected) |
North East | 500 | 100 | 400 | 300 | December 2014 | Future dates (promised-Expected) |
Please help me.
Thanks,
Sqlquery9