Home › Forums › kdb+ › window join on more than 2 columns ? › Reply To: window join on more than 2 columns ?
-
Hi fav_pa,
yes, a window join wj for several columns is possible. The syntax is
wj[w;c;t;(q;(f0;c0);(f1;c1))]
where w is your window, c are the columns you want to match on, in your case this would be sym, date time and trader type. As with the asof join, aj, the time column should be the last in your list, so I assume it’s sym,traderType,datetime (I am avoiding the symbol syntax because of the known UI issue).
You can read more about wj here https://code.kx.com/q4m3/9_Queries_q-sql/#999-window-join
code.kx.com
9. Queries – q-sql - Q for Mortals
Q for Mortals: a textbook for kdb+ and the q programming language