The calculation rules of the move function are similar to that of tmove. For each element Ti in T, return the element in X which is at the same position as (Ti - window) in T. If there is no match of (Ti - window) in T, return the corresponding element in X at the previous adjacent time of (Ti - window). For details, please refer to tmove — DolphinDB 1.30 documentation.
In your script, as there is no match of 08:20:58 (08:21:01 - 3s) and 08:20:59 (08:21:02 - 3s) in index, the corresponding element in x at the previous adjacent time (08:20:04) is returned.
T = (second(08:20:00)+1..4) join 08:21:01 join 08:21:02
X = 3 9 5 1 4 9
m = table(T as t,X as x)
select *, tmove(t, x, 3s) from m
// output
t x tmove_t
08:20:01 3
08:20:02 9
08:20:03 5
08:20:04 1 3
08:21:01 4 1
08:21:02 9 1
The calculation rules of the
movefunction are similar to that oftmove. For each element Ti in T, return the element in X which is at the same position as (Ti - window) in T. If there is no match of (Ti - window) in T, return the corresponding element in X at the previous adjacent time of (Ti - window). For details, please refer to tmove — DolphinDB 1.30 documentation.In your script, as there is no match of 08:20:58 (08:21:01 - 3s) and 08:20:59 (08:21:02 - 3s) in index, the corresponding element in x at the previous adjacent time (08:20:04) is returned.