Hello,
I need to calculate a moving average ( for time-series data). For that i planned to use RANGE BETWEEN <calculation> PRECEDING AND CURRENT ROW clause in SUM(), but it appears that RANGE is not implemented.
Here is my futile attempt to get to use the RANGE clause:
select ts.*, sum(ts.p) over( partition by ts.reqid, ts.tick_type_id order by ts.ts_sec RANGE BETWEEN TIMESTAMPADD(SQL_TSI_MINUTE, -p.param_value, ts.ts_sec) PRECEDING and CURRENT ROW) , TIMESTAMPADD(SQL_TSI_MINUTE, -p.param_value, ts.ts_sec)
from v_ticks_P_Sec ts, params p
where
p.param_name = 'W1'
;
and running into the error:
TT0805: Analytical function window clause with logical offset has not been implemented
The v_ticks_P_Sec view has all columns as "number" datatype and ts_sec is a timestamp;
Appreciate your guidance
thank you
AZ
Message was edited by: _AZ_ Added desc of the view (v_ticks_P_Sec)