Oh, first second third letters is:<o:p></o:p>
<o:p> </o:p>
q)update tc1:$string cond[;0], tc2:
$string cond[;1], tc3:`$string cond[;2] from t<o:p></o:p>
cond tc1 tc2 tc3<o:p></o:p>
-----------------<o:p></o:p>
“123” 1 2 3<o:p></o:p>
“abc” a b c<o:p></o:p>
“xyz” x y z<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
Not sure why you need the ssr but you can do this once if you need:<o:p></o:p>
<o:p> </o:p>
update tc1:$string cond[;0], tc2:
$string cond[;1], tc3:`$string cond[;2] from update ssr[;" “;”"]each cond from t<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
From: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] On Behalf Of David Demner (AquaQ)
Sent: Friday, July 3, 2015 11:43 AM
To: personal-kdbplus@googlegroups.com
Subject: RE: [personal kdb+] Multiple Each combined to one<o:p></o:p>
<o:p> </o:p>
q)t:(cond:(“1 2 3”;“a b c”;“x y z”))<o:p></o:p>
q)t,'flip tc1
tc2tc3!("SSS";" ") 0:t
cond<o:p></o:p>
cond tc1 tc2 tc3<o:p></o:p>
-------------------<o:p></o:p>
“1 2 3” 1 2 3<o:p></o:p>
“a b c” a b c<o:p></o:p>
“x y z” x y z<o:p></o:p>
<o:p> </o:p>
From: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] On Behalf Of Roni Hoffman
Sent: Friday, July 3, 2015 11:32 AM
To: personal-kdbplus@googlegroups.com
Subject: [personal kdb+] Multiple Each combined to one<o:p></o:p>
<o:p> </o:p>
Hello,<o:p></o:p>
<o:p> </o:p>
I have this query<o:p></o:p>
<o:p> </o:p>
select cond, tc1:{$(ssr[x;" ";""])(0)} each cond, tc2:{
$(ssr[x;" “;”“])(1)} each cond, tc3:{`$(ssr[x;” “;”"])(2)} each cond from trade<o:p></o:p>
<o:p> </o:p>
but its proving to be fairly slow. Wondering if anybody has any ideas on how to speed it up? Wondering if its possible to combine all the each iterations into one?<o:p></o:p>
<o:p> </o:p>
cond is a string and I want to pull the first, second and third letters out into their own columns.<o:p></o:p>
–
Submitted via Google Groups