can't make wj work...

I’m stuck - I don’t understand why this window join doesn’t work.

Tips appreciated.

q)show q;meta q

s t a b

-------------------------------------------------

ibm 2015.11.16D08:50:45.080000000 0.9476 0.9472

ibm 2015.11.17D11:49:36.935000000 0.46902 0.46872

ibm 2015.11.17D11:49:36.935000000 0.46901 0.46871

ibm 2015.11.17D11:49:36.935000000 0.46902 0.46872

ibm 2015.11.17D16:58:00.659000000 0.9476 0.9472

ibm 2015.11.17D16:58:00.659000000 0.94759 0.94719

c| t f a

-| -----

s| s s

t| p

a| e

b| e

q)show t;meta t

s t p

-------------------------------------------

ibm 2015.11.16D08:50:45.080000000 0.7081316

ibm 2015.11.17D16:58:00.659000000 0.7081316

ibm 2015.11.17D16:58:00.659000000 0.7081316

ibm 2015.11.17D11:49:36.935000000 0.7081316

ibm 2015.11.17D11:49:36.935000000 0.7081316

ibm 2015.11.17D11:49:36.935000000 0.7081316

c| t f a

-| -----

s| s

t| p

p| f

q)g

2015.11.16D08:00:00.000000000 2015.11.16D16:00:00.000000000 2015.11.17D00:00:00.000000000 2015.11.17D08:00:00.000000000

2015.11.16D16:00:00.000000000 2015.11.17D00:00:00.000000000 2015.11.17D08:00:00.000000000 2015.11.17D16:00:00.000000000

q)wj[g;st;t;(q;(::;a);(::;b))]

k){[a;w;f;y;z]f,:();e:+1_z;z:z;y,'+f!+{[e;d;a;b]e@‘d@:a+!b-a}[e;z f:|e]/’+$[#g;(g#z)?g#y;0]|/:a+$[#g:-1_f;(f#z)bin@[f#y;|f;:;]@;z[*f]bin]'w}

'length

@

bin[+`s`t!(`s#`ibm`ibm`ibm`ibm`ibm`ibm;2015.11.16D08:50:45.080000000 2015.11.17D11:49:36.935000000 2015.11.17D11:49:36.935000000 2015.11.17D11:49:36.93500000..

(2015.11.16D08:00:00.000000000 2015.11.16D16:00:00.000000000 2015.11.17D00:00:00.000000000 2015.11.17D08:00:00.000000000;2015.11.16D16:00:00.000000000 2015.1..

q.q))

Many thanks,

Jack

Hi Jack,

g should be pair of lists, each the same length/count of the table you are joining to.

Looks like the lists in g each have 4 and your table t is 6

Regards,

Paul