Hello,I am getting unexpected results with wj1 when the “quote” times I amjoining are within 1.0 of the window times.In the example below, I would expect x to be null in the last tworesults, but it is only null after I add 1.0 to the window times.Can anyone explain what's going on?Thanks,Leonq)t:([] time:1.5 1.6)q)q:([] time:1.1 1.2; x:
ab)q)w:-0.01 0.01+\:t.timeq)w1.49 1.591.51 1.61q)wj1[w;
time;t;(q;(::;x))]time x --------1.5 a b1.6 a bq)wj1[1+w;
time;t;(q;(::;`x))]time x------1.5 1.6
wj1 assumes the time column is an integer based time - not float. this means it won’t work with datetimes (type “z”) either.
if you change your example to integers, it works as expected:
t:(time:15 16)
q)q:(time:11 12; x:a
b)
q)w:-1 1+:t.time
q)wj1[w;time;t;(q;(::;
x))]
time x
15???
16???
Thanks for confirming. The integer limitation seems a bit strange. Iwould think that a window join on datetimes would be the most commonapplication.Having the function silently drop the fractional values rather thanthrow an error is particularly dangerous. I would not have noticed thisbehavior if I hadn’t taken a closer look at my results.LeonNick Psaris <nick.psaris> writes:> wj1 assumes the time column is an integer based time - not float. this> means it won’t work with datetimes (type “z”) either.>> if you change your example to integers, it works as expected:>> t:(time:15 16)> q)q:(time:11 12; x:a
b)> q)w:-1 1+:t.time> q)wj1[w;time;t;(q;(::;
x))]> time x> ------> 15> 16>>> On Thu, Mar 6, 2014 at 6:38 AM, Leon Baum wrote:>>>>> Hello,>>>> I am getting unexpected results with wj1 when the “quote” times I am>> joining are within 1.0 of the window times.>>>> In the example below, I would expect x to be null in the last two>> results, but it is only null after I add 1.0 to the window times.>>>> Can anyone explain what's going on?>>>> Thanks,>> Leon>>>>>> q)t:([] time:1.5 1.6)>> q)q:([] time:1.1 1.2; x:
ab)>> q)w:-0.01 0.01+\:t.time>> q)w>> 1.49 1.59>> 1.51 1.61>> q)wj1[w;
time;t;(q;(::;x))]>> time x>> -------->> 1.5 a b>> 1.6 a b>> q)wj1[1+w;
time;t;(q;(::;`x))]>> time x>> ------>> 1.5>> 1.6>>>> –>>
Submitted via Google Groups</nick.psaris>