wj1 rounding issue?

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:ab)
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:ab)> 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&gt;&gt; results, but it is only null after I add 1.0 to the window times.&gt;&gt;&gt;&gt; Can anyone explain what's going on?&gt;&gt;&gt;&gt; Thanks,&gt;&gt; Leon&gt;&gt;&gt;&gt;&gt;&gt; q)t:([] time:1.5 1.6)&gt;&gt; q)q:([] time:1.1 1.2; x:ab)&gt;&gt; q)w:-0.01 0.01+\:t.time&gt;&gt; q)w&gt;&gt; 1.49 1.59&gt;&gt; 1.51 1.61&gt;&gt; q)wj1[w;time;t;(q;(::;x))]&gt;&gt; time x&gt;&gt; --------&gt;&gt; 1.5 a b&gt;&gt; 1.6 a b&gt;&gt; q)wj1[1+w;time;t;(q;(::;`x))]>> time x>> ------>> 1.5>> 1.6>>>> –>>

Submitted via Google Groups</nick.psaris>