Try<o:p></o:p>
<o:p> </o:p>
q) .u.upd[`quote; value flip dataTable]<o:p></o:p>
<o:p> </o:p>
HTH,<o:p></o:p>
<o:p> </o:p>
Kim<o:p></o:p>
<o:p> </o:p>
Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von Yan Yan
Gesendet: Sonntag, 1. März 2015 22:13
An: personal-kdbplus@googlegroups.com
Betreff: Re: [personal kdb+] tick.q `length error<o:p></o:p>
<o:p> </o:p>
tyvm<o:p></o:p>
will it work if i make it convert to nested vectors automatically? does it work down the chain? thx<o:p></o:p>
<o:p> </o:p>
if[not system"t";system"t 1000";<o:p></o:p>
.z.ts:{ts .z.D};<o:p></o:p>
upd:{[t;x]ts"d"$a:.z.P;<o:p></o:p>
if[not -16=type first first x;a:“n”$a;x:$[0>type first x;a,x;(enlist(count first x)#a),x]];<o:p></o:p>
f:key flip value t;pub[t;$[0>type first x;enlist f!x;flip f!(value flip x)]];if[l;l enlist (`upd;t;x);i+:1];}];<o:p></o:p>
<o:p> </o:p>
On Sunday, March 1, 2015 at 9:50:53 PM UTC+8, wp wrote:<o:p></o:p>
tables as data (x param) are not supported in out-of-the-box tick.q.<o:p></o:p>
use nested vectors (one for each column) instead.<o:p></o:p>
<o:p> </o:p>
On Sun, Mar 1, 2015 at 12:12 PM, Yan Yan <lamh…@gmail.com> wrote:<o:p></o:p>
http://code.kx.com/wsvn/code/kx/kdb%2Btick/tick.q<o:p></o:p>
line 45 char 55-63<o:p></o:p>
<o:p> </o:p>
if[not system"t";system"t 1000";<o:p></o:p>
.z.ts:{ts .z.D};<o:p></o:p>
upd:{[t;x]ts"d"$a:.z.P;<o:p></o:p>
if[not -16=type first first x;a:“n”$a;x:$[0>type first x;a,x;(enlist(count first x)#a),x]];<o:p></o:p>
f:key flip value t;pub[t;$[0>type first x;enlist f!x;flip f!x]];if[l;l enlist (`upd;t;x);i+:1];}];<o:p></o:p>
<o:p> </o:p>
After calling .u.upd[quote; dataTable], I am getting a 'length error at "flip f!x". f is holding a list of symbols of the column names. x is holding the dataTable being inserted. The error is gone if I change "flip f!x" to "x". insert[
quote; dataTable] worked but .u.upd[`quote; dataTable] didn’t. Any idea? Thx.<o:p></o:p>
<o:p> </o:p>
–
Submitted via Google Groups