Thank you in advance.
I have a Mytable1
:
Site_name | date& Time |PowerOutput
xyz001 |2013-07-21 01:00:00.000 |192
xzu001 |2013-07-21 02:00:00.000 |189
abf003 |2013-07-21 03:00:00.000 |0
ACT0001 |2013-07-21 04:00:00.000 |178
I want to calculate average value of the previous row and the next row in case of ZERO.
My output table should be:
Sitename |date&time |Power_output
xyz001 |2013-07-21 01:00:00.000 |192
xzu001 |2013-07-21 02:00:00.000 |189
abf003 |2013-07-21 03:00:00.000 |189
ACT0001 |2013-07-21 04:00:00.000 |178
The logic is :
((Previous value-next value)/previous value) *100 <5, If this is true then it should insert the previous value
((Previous value-next value)/previous value)*100 >=5, If this is true then it should remain as zero.
Try This